decanter 0.1.6

This crate implements basic cryptographic primitives native to the ecosystem
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*
    Appellation: specs <module>
    Contrib: FL03 <jo3mccain@icloud.com>
*/

pub trait Concat {
    fn concat(&mut self, other: &Self) -> Self;
}

impl Concat for blake3::Hash {
    fn concat(&mut self, other: &Self) -> Self {
        let mut res: Vec<u8> = self.as_bytes().to_vec();

        let mut rhs: Vec<u8> = other.as_bytes().to_vec();
        res.append(&mut rhs);
        blake3::hash(&res)
    }
}