Skip to main content

decode

Function decode 

Source
pub fn decode(zbase32: &[u8], bits: u64) -> Result<Vec<u8>, &'static str>
Expand description

Decode first N bits of given zbase32 encoded data

§Panic

Panics if zbase32 decoded is shorter than N bits.

§Examples

use zbase32;

assert_eq!(zbase32::decode(b"o", 1).unwrap(), &[0x80]);