Library / System / Codecs / HexCodec
CLASS
HexCodec
Methods 4
METHOD toHex(REFERENCE ByteBuffer bb) RETURNS Stringreads
ByteBuffer -> hex string with " " between bytes. Empty buffer returns "". Each byte becomes two uppercase hex digits.
METHOD toHex(REFERENCE ByteBuffer bb, REFERENCE String separator) RETURNS Stringreads
ByteBuffer -> hex string with caller-chosen separator. Pass "" for compact ("3F406A"), " " for canonical ("3F 40 6A"), ":" for MAC-style.
METHOD toHex(binary b) RETURNS Stringreads
Single-byte hex form. Used by the kernel print/stringify dispatch as the
default formatter for the binary primitive. Returns exactly
two uppercase characters (e.g. "3F" for 0x3F, "00" for zero).
METHOD fromHex(REFERENCE String s) RETURNS | ByteBufferreads
Hex string -> ByteBuffer. Accepts upper/lowercase hex digits; ignores ASCII whitespace and standard separators (" ", ":", "-") so canonical / MAC / UUID formats round-trip. Pipe-XOR — FAILURE on any non-hex non-separator character or an odd digit count.