Skip to main content

decode_prefixed

Function decode_prefixed 

Source
pub fn decode_prefixed(expected: Tag, s: &str) -> Result<Zeroizing<Vec<u8>>>
Expand description

Decode a tag_<hexbody>_<hexchecksum> string, verifying both the tag and the checksum, and return the raw payload bytes.

The returned bytes are wrapped in Zeroizing so that decoding a secret key does not leave a readable copy on the heap once the caller is done with it.

Errors: