keccak256

To use the keccak256 function we must import it.


To hash multiple values we wrap them into a tuple however other compound types may be used.

fn keccak256_hashing(age: u64, name: str, status: bool) -> b256 {
    let mut hasher = Hasher::new();
    age.hash(hasher);
    hasher.write_str(name);
    status.hash(hasher);
    hasher.keccak256()
}