Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Hash a UTF-8 string using SHA-256 cryptographic hash function
import { SHA256 } from '@tevm/voltaire/SHA256'; import { Hex } from '@tevm/voltaire/Hex'; // Hash a simple string const message = "Hello, World!"; const hash = SHA256.hash(new TextEncoder().encode(message)); const hexHash = Hex.fromBytes(hash); // Hash another string const hash2 = SHA256.hash(new TextEncoder().encode("Voltaire")); const hexHash2 = Hex.fromBytes(hash2);
examples/hashing/sha256-hash.ts
Was this page helpful?
Suggestions