blockchain-scratch-rust 0.3.0

A scratched blockchain implementation
Documentation
1
2
3
4
5
6
7
8
9
10
use super::*;

///sha-256 means generate 32 byte hash
pub trait Hashable {
    fn bytes(&self) -> Vec<u8>;

    fn hash(&self) -> Hash {
        crypto_hash::digest(crypto_hash::Algorithm::SHA256, &self.bytes())
    }
}