Skip to main content
Deno 2 is finally here 🎉️
Learn more

SHA256.js

A simple SHA-256 hash functions for JavaScript ES modules supports UTF-8 encoding for browsers and Deno. (using Web Crypto API, can’t use on not SSL & Chrome, if you want use sha256-es)

Other platform

on Node.js js-sha256
on C# SHA256 class
on Python3 hashlib
on Ruby SHA256 class
on PHP hash

Sample

Usage

You could use like this:

import { SHA256 } from "https://code4fukui.github.io/SHA256/SHA256.js";

console.log(await SHA256.digest("Message to hash"));
/*
Uint8Array(32) [
  241, 170,  69, 176, 245, 246, 112,  52,
  104, 249, 185, 188,  43, 152, 116, 212,
  250, 107,   0,  26,  23,  13,  15,  19,
   42, 165, 162, 109,   0, 208, 199, 229
]
*/