xmtp_cryptography/
hash.rs

1pub use sha2::{Digest as Sha2Digest, Sha256 as Sha256Digest};
2
3/// Sha256 is used in places where cryptographic security is not required, as sha256 has a
4/// significant speed improvement over Keccak.
5#[allow(deprecated)]
6pub fn sha256_bytes(bytes: &[u8]) -> Vec<u8> {
7    let k = Sha256Digest::digest(bytes);
8
9    k.as_slice().to_vec()
10}