<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Faizan Shakeel</title>
    <description>The latest articles on DEV Community by Faizan Shakeel (@faizan_shakeel_1dda753363).</description>
    <link>https://dev.to/faizan_shakeel_1dda753363</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1886850%2Fe8b2fb6e-fa33-4533-bea8-9df0d978f3ac.jpeg</url>
      <title>DEV Community: Faizan Shakeel</title>
      <link>https://dev.to/faizan_shakeel_1dda753363</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/faizan_shakeel_1dda753363"/>
    <language>en</language>
    <item>
      <title>Stop pasting your JWTs into random websites to decode them</title>
      <dc:creator>Faizan Shakeel</dc:creator>
      <pubDate>Thu, 03 Sep 2026 16:14:06 +0000</pubDate>
      <link>https://dev.to/faizan_shakeel_1dda753363/stop-pasting-your-jwts-into-random-websites-to-decode-them-18nl</link>
      <guid>https://dev.to/faizan_shakeel_1dda753363/stop-pasting-your-jwts-into-random-websites-to-decode-them-18nl</guid>
      <description>&lt;p&gt;You've got a JWT and you need to see what's inside it — which user it's for, what scopes it carries, when it expires. The quick move is to search "jwt decoder," grab the first result, and paste your token in. &lt;strong&gt;Don't.&lt;/strong&gt; A JWT is often a live credential, and decoding one is so simple you never need to hand it to a stranger's server. Here's how it actually works.&lt;/p&gt;

&lt;h2&gt;
  
  
  A JWT is just three Base64 strings
&lt;/h2&gt;

&lt;p&gt;A JSON Web Token is three &lt;a href="https://www.toolnimbus.com/tools/base64-encoder-decoder" rel="noopener noreferrer"&gt;Base64&lt;/a&gt;-encoded parts joined by dots:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;header.payload.signature
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Header&lt;/strong&gt; — how the token is signed (e.g. &lt;code&gt;HS256&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Payload&lt;/strong&gt; — the claims: the actual data (user id, scopes, expiry).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Signature&lt;/strong&gt; — a cryptographic seal proving the token wasn't tampered with.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The first two parts aren't encrypted. They're just Base64URL — encoding, not secrecy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Decode it yourself in the console
&lt;/h2&gt;

&lt;p&gt;Because the header and payload are plain Base64, you can read them with nothing but the browser:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;decodeJwt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;token&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;part&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;seg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
    &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="nf"&gt;decodeURIComponent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="nf"&gt;atob&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;seg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/-/g&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;+&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/_/g&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
          &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
          &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;c&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;%&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;charCodeAt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;padStart&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;0&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
          &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;header&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;token&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;header&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;part&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;header&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="na"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;part&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;decodeJwt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;myToken&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// { header: { alg: "HS256", typ: "JWT" },&lt;/span&gt;
&lt;span class="c1"&gt;//   payload: { sub: "1234567890", name: "Jane Doe", exp: 1716242622 } }&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No library, no network request. The token never leaves the page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Decoding is not verifying
&lt;/h2&gt;

&lt;p&gt;This is the part people miss. Anyone can &lt;em&gt;decode&lt;/em&gt; a JWT — but that doesn't prove it's real. The signature is what proves authenticity, and checking it requires the secret or public key that signed it. &lt;code&gt;HS256&lt;/code&gt;, for example, is &lt;a href="https://www.toolnimbus.com/tools/hash-generator" rel="noopener noreferrer"&gt;HMAC&lt;/a&gt; with SHA-256.&lt;/p&gt;

&lt;p&gt;So: &lt;strong&gt;decoding shows you the contents; verifying proves you can trust them.&lt;/strong&gt; Never trust an unverified token server-side just because the payload looks right.&lt;/p&gt;

&lt;h2&gt;
  
  
  The payload is not secret
&lt;/h2&gt;

&lt;p&gt;Since the payload is only Base64, whoever holds the token can read every claim in it. Don't put anything sensitive — passwords, internal flags you don't want the user to see — inside a JWT payload.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reading the expiry
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;exp&lt;/code&gt;, &lt;code&gt;iat&lt;/code&gt;, and &lt;code&gt;nbf&lt;/code&gt; claims are &lt;a href="https://www.toolnimbus.com/tools/epoch-converter" rel="noopener noreferrer"&gt;Unix timestamps&lt;/a&gt;. &lt;code&gt;1716242622&lt;/code&gt; means nothing at a glance — convert it to a real date to see whether the token is still valid.&lt;/p&gt;

&lt;h2&gt;
  
  
  So why not just use a random decoder site?
&lt;/h2&gt;

&lt;p&gt;Because a live JWT is a &lt;strong&gt;bearer token&lt;/strong&gt; — practically a password until it expires. Many online decoders send what you paste to their backend, where it can be logged. If that token is still valid, you've just handed someone a working session. Decode it locally instead.&lt;/p&gt;

&lt;p&gt;That's exactly why I built &lt;a href="https://www.toolnimbus.com/tools/jwt-decoder" rel="noopener noreferrer"&gt;ToolNimbus JWT Decoder&lt;/a&gt; — it decodes the header, payload, and claims &lt;strong&gt;entirely in your browser&lt;/strong&gt;, converts the expiry to a readable date, and flags whether the token is still valid. Open your network tab while you use it: nothing gets sent.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.toolnimbus.com/tools/jwt-decoder" rel="noopener noreferrer"&gt;JWT Decoder&lt;/a&gt; — decode header, payload &amp;amp; claims client-side&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.toolnimbus.com/tools/base64-encoder-decoder" rel="noopener noreferrer"&gt;Base64 Encoder / Decoder&lt;/a&gt; — the encoding each JWT part uses&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.toolnimbus.com/tools/hash-generator" rel="noopener noreferrer"&gt;Hash Generator&lt;/a&gt; — the SHA family behind &lt;code&gt;HS256&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;How do you inspect tokens while debugging — console, an extension, or a decoder? Curious what people reach for.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvgv5qrvk2ps7k9i56rv6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvgv5qrvk2ps7k9i56rv6.png" alt=" " width="800" height="343"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>security</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>The browser has a crypto library built in — you probably don't need a package</title>
      <dc:creator>Faizan Shakeel</dc:creator>
      <pubDate>Mon, 27 Jul 2026 08:26:15 +0000</pubDate>
      <link>https://dev.to/faizan_shakeel_1dda753363/the-browser-has-a-crypto-library-built-in-you-probably-dont-need-a-package-3fh7</link>
      <guid>https://dev.to/faizan_shakeel_1dda753363/the-browser-has-a-crypto-library-built-in-you-probably-dont-need-a-package-3fh7</guid>
      <description>&lt;p&gt;Reach for "generate a secure password" or "hash this string" in JavaScript and the instinct is to &lt;code&gt;npm install&lt;/code&gt; something. Most of the time you don't have to. Every modern browser ships the &lt;strong&gt;Web Crypto API&lt;/strong&gt; on &lt;code&gt;window.crypto&lt;/code&gt; — a fast, audited, native cryptography toolkit. Here are three things it does with zero dependencies.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Cryptographically secure random values
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;Math.random()&lt;/code&gt; is not safe for anything security-sensitive — it's predictable. For passwords, tokens, or salts you want &lt;code&gt;crypto.getRandomValues()&lt;/code&gt;, which pulls from the OS entropy source:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;securePassword&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;charset&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&amp;amp;*&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;values&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getRandomValues&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Uint32Array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;values&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;v&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;charset&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;v&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="nx"&gt;charset&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;]).&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;securePassword&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// e.g. "kR7$mQ2xL9!pW4nZ8vT#"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No library, no server round-trip — the randomness comes straight from the platform.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. UUIDs in one line
&lt;/h2&gt;

&lt;p&gt;Need a unique ID? There's now a native call for that:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;randomUUID&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// "36b8f84d-df4e-4d49-b662-bbfa2d9f4c15"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's a spec-compliant v4 UUID, no &lt;code&gt;uuid&lt;/code&gt; package required.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Hashing with SubtleCrypto
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;crypto.subtle&lt;/code&gt; handles real hashing. Here's SHA-256 of a string:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;sha256&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;TextEncoder&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;buffer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;subtle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;digest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;SHA-256&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Uint8Array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;padStart&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;0&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;sha256&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hello world&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;subtle.digest&lt;/code&gt; supports SHA-1, SHA-256, SHA-384 and SHA-512. (MD5 isn't included — it's cryptographically broken — so for legacy MD5 checksums you do still need a small library.)&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this matters beyond saving a dependency
&lt;/h2&gt;

&lt;p&gt;Because it's native, the data never leaves the page. There's no request to a server, nothing logged, nothing to trust but the browser you already trust. That's the right model for anything sensitive.&lt;/p&gt;

&lt;p&gt;It's also the model I built &lt;a href="https://www.toolnimbus.com" rel="noopener noreferrer"&gt;ToolNimbus&lt;/a&gt; on — a set of free tools that run entirely client-side. If you'd rather not paste the snippets, the same primitives are wired up here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.toolnimbus.com/tools/password-generator" rel="noopener noreferrer"&gt;Password Generator&lt;/a&gt; — &lt;code&gt;getRandomValues&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.toolnimbus.com/tools/uuid-generator" rel="noopener noreferrer"&gt;UUID Generator&lt;/a&gt; — &lt;code&gt;randomUUID&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.toolnimbus.com/tools/hash-generator" rel="noopener noreferrer"&gt;Hash Generator&lt;/a&gt; — &lt;code&gt;subtle.digest&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Open the network tab while you use them — you'll see nothing gets sent. That's the whole point of the native API.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;What else have you built on Web Crypto instead of reaching for a package? I'd love to hear about it in the comments.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fshkop43r2kolsh3nbelu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fshkop43r2kolsh3nbelu.png" alt=" " width="800" height="343"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>security</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
