calculate_tree_hash

Function calculate_tree_hash 

Source
pub fn calculate_tree_hash(data: &[u8]) -> Vec<u8> 
Expand description

Calculate the Amazon SHA256 tree hash as described on Checksum Calculation page of the AWS S3 Glacier developer guide. The function is meant to be used on the complete data in the case of an upload in a single request and on each part in case of a multi-part upload.

§Example

assert_eq!(
    aws_tree_hash::calculate_tree_hash(&[0; 7680000]),
    Vec::from_hex("7a43777ddc7a0326d36b15bc482e6c7736e1c2e9d80a647e8c301646f6a4785c").unwrap()
);