Lyricdev
GitHub

struct Hex

pub struct Hex

Hexadecimal, two digits per byte: encode writes small letters, decode reads either case.

Methods

pub static fn encode(bytes: Slice<uint8>): string

Returns bytes as hexadecimal text in small letters.

pub static fn decode(s: StringView): uint8[] throws EncodingError

Returns the bytes that the hexadecimal text s encodes, in either case.

Errors

Throws EncodingError for a character that is not a hexadecimal digit and for an odd length.