pub fn from_bytes(data: [u8; 256]) -> Self {
        let sha = Sha1::from(&data[..]).digest().bytes();
        let aux_hash = {
            let mut buffer = [0; 8];
            buffer.copy_from_slice(&sha[0..8]);
            buffer
        };
        let key_id = {
            let mut buffer = [0; 8];
            buffer.copy_from_slice(&sha[12..12 + 8]);
            buffer
        };

        Self {
            data,
            aux_hash,
            key_id,
        }
    }
/// Creates a new authorization key from the given binary data.
Creates a new authorization key from the given binary data.
Creates a new authorization key from the given binary data .
pub fn from_bytes(data: [u8; 256]) -> Self {
        let sha = Sha1::from(&data[..]).digest().bytes();
        let aux_hash = {
            let mut buffer = [0; 8];
            buffer.copy_from_slice(&sha[0..8]);
            buffer
        };
        let key_id = {
            let mut buffer = [0; 8];
            buffer.copy_from_slice(&sha[12..12 + 8]);
            buffer
        };
        Self {
            data,
            aux_hash,
            key_id,
        }
    }
pub fn from_bytes ( data : [ u8 ; 256 ] ) -> Self { let sha = Sha1 :: from ( & data [ .. ] ) . digest ( ) . bytes ( ) ; let aux_hash = { let mut buffer = [ 0 ; 8 ] ; buffer . copy_from_slice ( & sha [ 0 .. 8 ] ) ; buffer } ; let key_id = { let mut buffer = [ 0 ; 8 ] ; buffer . copy_from_slice ( & sha [ 12 .. 12 + 8 ] ) ; buffer } ; Self { data , aux_hash , key_id , } }
Creates a new authorization key from the given binary data.
Creates a new authorization key from the given binary data .
data
[u8; 256]
data
[u8; 256]