pub fn decrypt(data: &[u8], password: &str) -> VResult<Book> {
    Ok(EncryptedVault::from_bytes(data)
        .map_err(|_| Error::VaultCorrupted)?
        .decrypt(password)
        .ok_or(Error::WrongPassword)?
        .content)
}
/// Decrypt vault bytes to a book
Decrypt vault bytes to a book
Decrypt vault bytes to a book
pub fn decrypt(data: &[u8], password: &str) -> VResult<Book> {
    Ok(EncryptedVault::from_bytes(data)
        .map_err(|_| Error::VaultCorrupted)?
        .decrypt(password)
        .ok_or(Error::WrongPassword)?
        .content)
}
pub fn decrypt ( data : & [ u8 ] , password : & str ) -> VResult < Book > { Ok ( EncryptedVault :: from_bytes ( data ) . map_err ( | _ | Error :: VaultCorrupted ) ? . decrypt ( password ) . ok_or ( Error :: WrongPassword ) ? . content ) }
Decrypt vault bytes to a book
Decrypt vault bytes to a book
data
&[u8]
password
&str
data
&[u8]
password
&str