Skip to main content

encode_string_hex

Function encode_string_hex 

Source
pub fn encode_string_hex(bytes: &[u8]) -> Vec<u8> 
Expand description

Spell bytes as a hexadecimal string: <…> with uppercase digit pairs.

use pdfrum_object::encode_string_hex;

assert_eq!(encode_string_hex(b"\x12\xac"), b"<12AC>");
assert_eq!(encode_string_hex(b""), b"<>");