std.base32
rfc 4648; strict: padding as the codec says, lowercase ok, no whitespace
Base32Error
Section titled “Base32Error”pub Base32Error :: errors { invalid_character, invalid_length, buffer_too_small,}invalid_character: not in the alphabet, or a stray=invalid_length: a length no encoding hasbuffer_too_small:outtoo small; nothing written
pub Codec :: struct { chars: []const u8, pad: bool,}alphabet and padding
Codec.encoded_len
Section titled “Codec.encoded_len”pub encoded_len :: fn(self: *Self, n: usize) -> usizetext length for n bytes
Codec.decoded_len
Section titled “Codec.decoded_len”pub decoded_len :: fn(self: *Self, text: []const u8) -> usize ! Base32Errorbyte length of well-formed text
Codec.encode
Section titled “Codec.encode”pub encode :: fn(self: *Self, out: []u8, src: []const u8) -> usize ! Base32Errorinto out; returns the length (encoded_len)
Codec.decode
Section titled “Codec.decode”pub decode :: fn(self: *Self, out: []u8, text: []const u8) -> usize ! Base32Errorinto out; returns the length; bits past the last whole byte ignored
Codec.encode_in
Section titled “Codec.encode_in”pub encode_in :: fn(self: *Self, a: *Arena, src: []const u8) -> []u8in a
Codec.decode_in
Section titled “Codec.decode_in”pub decode_in :: fn(self: *Self, a: *Arena, text: []const u8) -> []u8 ! Base32Errorin a
STANDARD
Section titled “STANDARD”pub STANDARD: Codec = .{ STANDARD_CHARS, true }STANDARD_NO_PAD
Section titled “STANDARD_NO_PAD”pub STANDARD_NO_PAD: Codec = .{ STANDARD_CHARS, false }pub HEX: Codec = .{ HEX_CHARS, true }HEX_NO_PAD
Section titled “HEX_NO_PAD”pub HEX_NO_PAD: Codec = .{ HEX_CHARS, false }encode_in
Section titled “encode_in”pub encode_in :: fn(a: *Arena, src: []const u8) -> []u8STANDARD.encode_in; in a
decode_in
Section titled “decode_in”pub decode_in :: fn(a: *Arena, text: []const u8) -> []u8 ! Base32ErrorSTANDARD.decode_in; in a