`Base32` encoding and decoding, as specified in [[ RFC 4648; https://www.rfc-editor.org/rfc/rfc4648.html ]]. A secondary param can be used to supply a custom alphabet to `encode` and a matching decoding table to `decode`. If none is supplied it just uses the standard Base32 alphabet. In case your specific version does not use padding, you may truncate it from the encoded output. Error represents errors that can occur during base32 decoding operations. As per RFC 4648: - Section 3.3: Invalid character handling - Section 3.2: Padding requirements - Section 6: Base32 encoding specifics (including block size requirements)

Collection Info

View Source
Collection
core
Path
encoding/base32
Entries
7

Source Files

Constants

1

Types

2

Procedures

2

decode #

Source
@(optimization_mode="favor_size")
decode :: proc(data: string, DEC_TBL: [256]u8 = DEC_TABLE, validate: Validate_Proc = _validate_default, allocator := context.allocator) -> (out: []u8, err: Error) {…}

encode #

Source
encode :: proc(data: []u8, ENC_TBL: [32]u8 = ENC_TABLE, allocator := context.allocator) -> string {…}

Variables

2

DEC_TABLE #

Source
@(rodata)
DEC_TABLE: [256]u8 = [256]u8{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 27, 28, 29, 30, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}

ENC_TABLE #

Source
@(rodata)
ENC_TABLE: [32]u8 = [32]byte{'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '2', '3', '4', '5', '6', '7'}