Function scsys_crypto::hasher

source ·
pub fn hasher<T: ToString>(data: &T) -> GenericHash
Expand description

hasher implements a generic hash function wrapper around blake3

Examples found in repository?
src/hash/hasher.rs (line 18)
14
15
16
17
18
19
    pub fn new<T>(data: T) -> Self
    where
        T: ToString,
    {
        Self(hasher(&data))
    }
More examples
Hide additional examples
src/lib.rs (line 26)
25
26
27
28
29
30
31
32
33
        fn hasher(&self, deg: Option<usize>) -> H256 {
            let s: H256 = hasher(&self).into();

            let mut res: H256 = s;
            for _ in 0..deg.unwrap_or(1) {
                res = hasher(&res.clone()).into()
            }
            res
        }