core/encoding/base64
encoding_base64
Types
2Decode_Error
Decode_Error :: enum int {
None = 0,
Invalid_Character = 1,
}SourceError
Error :: union {
runtime.Allocator_Error,
io.Error,
Decode_Error,
}SourceConstants
1Variables
4DEC_TABLE
DEC_TABLE :: [256]i8 = [256]i8 {
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, 62, -1, -1, -1, 63,
52, 53, 54, 55, 56, 57, 58SourceDEC_URL_TABLE
DEC_URL_TABLE :: [256]i8 = [256]i8 {
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 62, -1, -1,
52, 53, 54, 55, 56, 57, 58SourceDecoding table for Base64url variant
ENC_TABLE
ENC_TABLE :: [64]u8 = [64]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', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
'o', 'p', 'q', 'r', 'SourceENC_URL_TABLE
ENC_URL_TABLE :: [64]u8 = [64]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', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
'o', 'p', 'q', 'r', 'SourceEncoding table for Base64url variant
Procedures
8decode
decode :: proc(data: string, DEC_TBL = DEC_TABLE, dst: []u8, allocator: mem.Allocator = context.allocator) -> (decoded: []u8, err: Error)Sourcedecode_into
decode_into :: proc(w: io.Writer, data: string, DEC_TBL = DEC_TABLE) -> (Error)Sourcedecode_into_buf
decode_into_buf :: proc(dst: []u8, data: string, DEC_TBL = DEC_TABLE) -> (decoded: []u8, err: Error)Sourcedecoded_len
decoded_len :: proc(data: string) -> (int)Sourceencode
encode :: proc(data: []u8, ENC_TBL = ENC_TABLE, allocator: mem.Allocator = context.allocator) -> (encoded: string, err: runtime.Allocator_Error)Sourceencode_into
encode_into :: proc(w: io.Writer, data: []u8, ENC_TBL = ENC_TABLE) -> (io.Error)Sourceencode_into_buf
encode_into_buf :: proc(dst: []u8, data: []u8, ENC_TBL = ENC_TABLE) -> (encoded: []u8, err: Error)Sourceencoded_len
encoded_len :: proc(data: []u8) -> (int)Source