Skip to main content

hex_encode_upper

Function hex_encode_upper 

Source
pub fn hex_encode_upper<'a>(
    src: &[u8],
    dst: &'a mut [u8],
) -> Result<&'a mut str, Error>
Expand description

Encodes all of src as uppercase hex into dst without allocation.

This has the same length, borrowing and destination-preservation guarantees as hex_encode, using A through F instead of a through f.

§Errors

Returns Error::Overflow or Error::OutputTooSmall under the same conditions as hex_encode. An error leaves the entire destination unchanged.

§Examples

let mut destination = [0; 6];
assert_eq!(faster_hex::hex_encode_upper(&[0, 0xab, 0xff], &mut destination)?,
           "00ABFF");