Function fuchsia_merkle::hash_block
source · pub fn hash_block(block: &[u8], offset: usize) -> Hash
Expand description
Compute the merkle hash of a block of data.
A merkle hash is the SHA-256 hash of a block of data with a small header built from the length
of the data, the level of the tree (0 for data blocks), and the offset into the level. The
block will be zero filled if its len is less than BLOCK_SIZE
, except for when the first
data block is completely empty.
§Panics
Panics if block.len()
exceeds BLOCK_SIZE
or if offset
is not aligned to BLOCK_SIZE