base32

Base32 encoder and decoder, according to RFC 4648.

Members

Aliases

Base32
alias Base32 = Base32Impl!()

The standard _base32 encoding, containing A-Z, 2-7 and =.

Base32Hex
alias Base32Hex = Base32Impl!(UseHex.yes)

The _base32 encoding with "extended hex alphabet", also known as "base32hex", containing 0-9, A-V, and =.

UseHex
alias UseHex = Flag!"base32hex"
UsePad
alias UsePad = Flag!"base32pad"

Classes

Base32Exception
class Base32Exception

Exception thrown on errors in _base32 functions.

Templates

Base32Impl
template Base32Impl(UseHex useHex = UseHex.no, UsePad usePad = UsePad.yes)

Implementation for _base32.

Examples

1 ubyte[] data = [0xde, 0xad, 0xbe, 0xef, 0x01, 0x23];
2 
3 const(char)[] encoded = Base32.encode(data);
4 assert(encoded == "32W353YBEM======");
5 
6 ubyte[] decoded = Base32.decode("32W353YBEM======");
7 assert(decoded == [0xde, 0xad, 0xbe, 0xef, 0x01, 0x23]);

Meta

Authors

Kazuya Takahashi