pub fn blockchain_sha256(prev_hash: &[u8], data: &[u8], out: &mut [u8]) {
    let mut hasher = Sha256::new();
    hasher.input(data);
    let mut current_hash = [0; 32];
    hasher.result(&mut current_hash);
    let mut buf = Vec::with_capacity(prev_hash.len() + current_hash.len());
    buf.extend_from_slice(prev_hash);
    buf.extend_from_slice(&current_hash);
    let mut hasher = Sha256::new();
    hasher.input(&buf);
    hasher.result(out);
}
/// Returns hash of significant data of current record of file (hash of sum of prev hash and hash of current line data).
Returns hash of significant data of current record of file (hash of sum of prev hash and hash of current line data).
Returns hash of significant data of current record of file ( hash of sum of prev hash and hash of current line data ) .
pub fn blockchain_sha256(prev_hash: &[u8], data: &[u8], out: &mut [u8]) {
    let mut hasher = Sha256::new();
    hasher.input(data);
    let mut current_hash = [0; 32];
    hasher.result(&mut current_hash);
    let mut buf = Vec::with_capacity(prev_hash.len() + current_hash.len());
    buf.extend_from_slice(prev_hash);
    buf.extend_from_slice(&current_hash);
    let mut hasher = Sha256::new();
    hasher.input(&buf);
    hasher.result(out);
}
pub fn blockchain_sha256 ( prev_hash : & [ u8 ] , data : & [ u8 ] , out : & mut [ u8 ] ) { let mut hasher = Sha256 :: new ( ) ; hasher . input ( data ) ; let mut current_hash = [ 0 ; 32 ] ; hasher . result ( & mut current_hash ) ; let mut buf = Vec :: with_capacity ( prev_hash . len ( ) + current_hash . len ( ) ) ; buf . extend_from_slice ( prev_hash ) ; buf . extend_from_slice ( & current_hash ) ; let mut hasher = Sha256 :: new ( ) ; hasher . input ( & buf ) ; hasher . result ( out ) ; }
Returns hash of significant data of current record of file (hash of sum of prev hash and hash of current line data).
Returns hash of significant data of current record of file ( hash of sum of prev hash and hash of current line data ) .
prev_hash
&[u8]
data
&[u8]
out
&mut [u8]
prev_hash
&[u8]
data
&[u8]
out
&mut [u8]