Function keccak256_array

Source
pub fn keccak256_array(value: &[u8]) -> [u8; 32]
Expand description

Hashes the bytes using the Keccak-256 hash function. This returns a 32 byte hash.

ยงExamples

use near_sdk::env::keccak256_array;
use hex;

assert_eq!(
    &keccak256_array(b"The phrase that will be hashed"),
    hex::decode("b244af9dd4aada2eda59130bbcff112f29b427d924b654aaeb5a0384fa9afed4")
        .expect("Decoding failed")
        .as_slice()
);