hash Generate SHA-256 hash
Examples
Compute SHA-256 hash of a string
Usage
"hello world" | hash Generate a hash to verify file integrity
Usage
"document-v2-final.pdf" | hash Create a deterministic ID from order data
Usage
"[email protected]" | hash View source
async (input)=>{
const data = new TextEncoder().encode(input);
const hash = await crypto.subtle.digest("SHA-256", data);
return Array.from(new Uint8Array(hash)).map((b)=>b.toString(16).padStart(2, "0")).join("");
}