Function std::hash::sha256

pub fn sha256<T>(val: T) -> b256
where
    T: Hash,
Expand description

Returns the SHA-2-256 hash of val.

Arguments

  • val: [T] - The value to be hashed.

Returns

  • [b256] - The sha-256 hash of the val.

Examples

use std::hash::*;

fn foo() {
    let result = sha256("Fuel");
    assert_eq(result, 0xa80f942f4112036dfc2da86daf6d2ef6ede3164dd56d1000eb82fa87c992450f);
}