Computes the keccak256 hash of raw byte data, commonly used for creating deterministic identifiers and verifying data integrity.
const data = new Uint8Array([1, 2, 3, 4, 5]);const result = await keccak256(data);if (result.error) { console.error("Hash generation failed:", result.error.readableMsg);}const hash = result.value;// Do something with the hash Copy
const data = new Uint8Array([1, 2, 3, 4, 5]);const result = await keccak256(data);if (result.error) { console.error("Hash generation failed:", result.error.readableMsg);}const hash = result.value;// Do something with the hash
Raw byte array to hash (Uint8Array in JavaScript)
Hex-encoded hash with 0x prefix (66 characters total)
Computes the keccak256 hash of raw byte data, commonly used for creating deterministic identifiers and verifying data integrity.
Examples