std.hex
bytes <-> hex; encodes lowercase (or upper), decodes either case
HexError
Section titled “HexError”pub HexError :: errors { invalid_character, odd_length, buffer_too_small,}invalid_character: not a hex digitodd_length: half a byte at the endbuffer_too_small:outtoo small; nothing written
encode
Section titled “encode”pub encode :: fn(out: []u8, src: []const u8) -> usize ! HexErrorlowercase hex of src into out; returns 2 * src.len
encode_upper
Section titled “encode_upper”pub encode_upper :: fn(out: []u8, src: []const u8) -> usize ! HexErrorencode, uppercase
encode_in
Section titled “encode_in”pub encode_in :: fn(a: *Arena, src: []const u8) -> []u8lowercase hex of src, in a
encode_upper_in
Section titled “encode_upper_in”pub encode_upper_in :: fn(a: *Arena, src: []const u8) -> []u8uppercase hex of src, in a
digit_value
Section titled “digit_value”pub digit_value :: fn(c: u8) -> ?u8value of hex digit c, either case; null if not hex
decode
Section titled “decode”pub decode :: fn(out: []u8, text: []const u8) -> usize ! HexErrordecode text into out; returns text.len / 2; writes nothing on error
decode_in
Section titled “decode_in”pub decode_in :: fn(a: *Arena, text: []const u8) -> []u8 ! HexErrordecode text into a