scsys-crypto 0.3.2

cryptographic primitives and utilities for the scsys ecosystem
Documentation
1
2
3
4
5
6
7
8
9
10
11
/*
    Appellation: convert <module>
    Contrib: @FL03
*/

/// Utility functions for converting between different cryptographic representations
pub fn digest_to_hash<const N: usize>(hash: impl AsRef<[u8]>) -> [u8; N] {
    let mut raw_hash: [u8; N] = [0; N];
    raw_hash[0..N].copy_from_slice(hash.as_ref());
    raw_hash
}