/// Serialize the HashDescriptor in the format expected by VBMeta.
Serialize the HashDescriptor in the format expected by VBMeta.
Serialize the HashDescriptor in the format expected by VBMeta .
pub fn to_bytes(&self) -> Vec<u8> {
        let mut bytes: Vec<u8> = Vec::new();
        bytes.extend_from_slice(self.header.as_bytes());
        bytes.extend_from_slice(self.image_name.as_bytes());
        bytes.extend_from_slice(&self.salt.bytes);
        bytes.extend_from_slice(&self.digest);
        // Pad to the nearest 8 byte boundary.
        let length_with_padding = bytes.len() + 7 & !7;
        bytes.resize(length_with_padding, 0);
        bytes
    }
pub fn to_bytes ( & self ) -> Vec < u8 > { let mut bytes : Vec < u8 > = Vec :: new ( ) ; bytes . extend_from_slice ( self . header . as_bytes ( ) ) ; bytes . extend_from_slice ( self . image_name . as_bytes ( ) ) ; bytes . extend_from_slice ( & self . salt . bytes ) ; bytes . extend_from_slice ( & self . digest ) ; // Pad to the nearest 8 byte boundary. let length_with_padding = bytes . len ( ) + 7 & ! 7 ; bytes . resize ( length_with_padding , 0 ) ; bytes }
Serialize the HashDescriptor in the format expected by VBMeta.
Serialize the HashDescriptor in the format expected by VBMeta .
&self