[][src]Crate koibumi_base32

This crate is a Base32 encoder/decoder library.

The library is intended to be used to implement an Onion address encoder/decoder. The library uses RFC 4648 Base32 alphabet, but encoded string is lowercase by default. The library does not support padding.

Examples

use koibumi_base32 as base32;

let test = base32::encode(b"hello");
let expected = "nbswy3dp";
assert_eq!(test, expected);
use koibumi_base32 as base32;

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

Structs

InvalidCharacter

Indicates that an invalid Base32 character was found.

Functions

decode

Decodes Base32 string into byte array.

encode

Encodes byte array into Base32 string.