Lyric v3.5.0

std.encoding

hexEncode function

pub fn hexEncode(bytes: uint8[]): string

Bytes as lowercase hexadecimal, two characters per byte, no separators. Empty bytes are the empty string.

stdlib/std/encoding.lyr:44

hexDecode function

pub fn hexDecode(text: string): ?uint8[]

The bytes a hexadecimal string spells, or null when it spells none: an odd length or a character outside 0-9, a-f, A-F. The empty string is an empty array.

stdlib/std/encoding.lyr:58

base64Encode function

pub fn base64Encode(bytes: uint8[]): string

Bytes as base64 (RFC 4648 §4: A-Za-z0-9+/), padded with = to a multiple of four characters. Empty bytes are the empty string.

stdlib/std/encoding.lyr:80

base64Decode function

pub fn base64Decode(text: string): ?uint8[]

The bytes a base64 string spells, or null when it spells none. Strict: the length must be a multiple of four, = may appear only as the final one or two characters, characters outside the alphabet are refused, and so is padding whose unused bits are not zero — accepted input is exactly what base64Encode produces. The empty string is an empty array.

stdlib/std/encoding.lyr:128