Function koibumi_base32::decode

source ·
pub fn decode(s: impl AsRef<str>) -> Result<Vec<u8>, InvalidCharacter>
Expand description

Decodes Base32 string into byte array.

The input is Base32 encoded lowercase str reference and the output is arbitrary Vec<u8>. Using lowercase RFC4648 alphabet and can be used for Onion addresses. Padding is not supported.

§Examples

use koibumi_base32 as base32;

let test = base32::decode("nbswy3dp")?;
let expected = b"hello";
assert_eq!(test, expected);