
I got tired of pasting sensitive strings into random websites, so I built a browser-based hash generator
I work on a few different projects and I hash things constantly — checking file integrity, debugging password logic, verifying API payloads. For a long time I just googled "md5 generator" or "sha256 online" and used whatever came up first. Then one day I actually looked at one of those tools in DevTools. The input was being sent to a server on every keystroke. For MD5 it probably doesn't matter. But I sometimes paste things that are closer to sensitive — partial tokens, config values, test passwords. That felt dumb. So I built my own. How it works The SHA family (SHA-1, SHA-256, SHA-512) is natively supported in the browser via the Web Crypto API: async function sha256 ( message ) { const msgBuffer = new TextEncoder (). encode ( message ); const hashBuffer = await crypto . subtle . digest ( ' SHA-256 ' , msgBuffer ); const hashArray = Array . from ( new Uint8Array ( hashBuffer )); return hashArray . map ( b => b . toString ( 16 ). padStart ( 2 , ' 0 ' )). join ( '' ); } No libraries, n
Continue reading on Dev.to Webdev
Opens in a new tab


