Skip to main content

hex_append_upper

Function hex_append_upper 

Source
pub fn hex_append_upper<'a>(src: &[u8], dst: &'a mut String) -> &'a mut str
Available on crate feature alloc only.
Expand description

Appends uppercase hexadecimal digits to dst and returns the appended suffix.

Available with alloc. Existing content and capacity are handled as in hex_append; only the new hex digits use uppercase letters.

§Panics

Panics on the same capacity overflows as hex_append. Allocation failure follows the allocator’s error handling.

§Examples

let mut text = String::from("hash: ");
assert_eq!(faster_hex::hex_append_upper(&[0xab, 0xcd], &mut text), "ABCD");
assert_eq!(text, "hash: ABCD");