clvmr 0.19.0

Implementation of `clvm` for Chia Network's cryptocurrency
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use chia_sha2::Sha256;

pub type Bytes32 = [u8; 32];

pub fn hash_blob(blob: &[u8]) -> Bytes32 {
    let mut sha256 = Sha256::new();
    sha256.update(blob);
    sha256.finalize()
}

pub fn hash_blobs(blobs: &[&[u8]]) -> Bytes32 {
    let mut sha256 = Sha256::new();
    for blob in blobs.iter() {
        sha256.update(blob);
    }
    sha256.finalize()
}