Expand description

SIMD-accelerated hex encoding and decoding.

Examples

use hex_simd::AsciiCase;

let bytes = b"Hello world!";

let encoded = hex_simd::encode_to_boxed_str(bytes, AsciiCase::Lower);
assert_eq!(&*encoded, "48656c6c6f20776f726c6421");

let decoded = hex_simd::decode_to_boxed_bytes(encoded.as_bytes()).unwrap();
assert_eq!(&*decoded, bytes);

Modules

Structs

Hex Error

A fixed-length hex string

A write-only slice of bytes.

Enums

Functions

Checks whether src is a hex string.

Decodes src case-insensitively and writes to dst.

Decodes buf case-insensitively and writes inplace.

Decodes src and returns Box<[u8]>.

Encodes src with a given ascii case and writes to dst.

Encodes src to dst and returns &mut str.

Encodes src and returns Box<str>.

Encodes src to a hex string in network byte order