ByteArray.
Signature
Arguments
arr- The input bytes to hash
Returns
The 32-byte Keccak-256 hash as a little-endianu256
ByteArray.
pub fn compute_keccak_byte_array(arr: ByteArray) -> u256
arr - The input bytes to hashu256
use core::keccak::compute_keccak_byte_array;
let text: ByteArray = "Hello world!";
let hash = compute_keccak_byte_array(@text);
assert!(hash == 0xabea1f2503529a21734e2077c8b584d7bee3f45550c2d2f12a198ea908e1d0ec);
Was this page helpful?