nupp.codec.hex

Hexadecimal byte encoding. Encoders emit lowercase; decoders accept either case.

Module contents

Functions

FunctionKindDescription
decodefunctionDecodes hexadecimal without whitespace or a prefix.
encodefunctionEncodes raw bytes as lowercase hexadecimal.

Functions#

decodefunction#

function decode(text: string): string?, string?

Decodes hexadecimal without whitespace or a prefix.

Arguments

NameTypeDescription
textstring

Returns

TypeDescription
string?

raw bytes, or nil and a reason

string?

encodefunction#

function encode(bytes: string): string

Encodes raw bytes as lowercase hexadecimal.

Arguments

NameTypeDescription
bytesstring

Returns

TypeDescription
string