logos.mem.encoding.hex

Module mem · package logos-mem

Functions

fnhex_decode

fn hex_decode(src: *const u8, len: i64, out: &mut String) -> i64

Decodes hex string src (len must be even) and appends the bytes to out. Returns the number of bytes appended, or -1 if len is odd or a char is not a hex digit.

fnhex_decode_str

fn hex_decode_str(src: &[u8], out: &mut String) -> i64

Decodes hex string src and appends the bytes to out. Returns the number of bytes appended, or -1 on malformed input (see hex_decode).

fnhex_encode

fn hex_encode(src: *const u8, len: i64, out: &mut String) -> void

Encodes len bytes from src as lowercase hex. Appends 2*len chars to out.

fnhex_encode_str

fn hex_encode_str(src: &[u8], out: &mut String) -> void

Encodes src as lowercase hex and appends it to out.