pub fn leaf_digest(data: b256) -> b256 
Expand description

Returns the computed leaf hash of “MTH({d(0)}) = SHA-256(0x00 || d(0))”.

Arguments

  • ‘data’: [b256] - The hash of the leaf data.

Returns

  • [b256] - The computed hash.

Examples

use sway_libs::merkle::binary_proof::leaf_digest;

fn foo() {
    let data = b256::zero();
    let digest = leaf_digest(data);
    assert(digest == 0x54f05a87f5b881780cdc40e3fddfebf72e3ba7e5f65405ab121c7f22d9849ab4);
}