#hex #hex-string #codec #decoding #representation #encode #data

no-std hex-noalloc

Encoding and decoding data into/from hexadecimal representation

1 unstable release

Uses old Rust 2015

0.3.2 Nov 28, 2020

#2484 in Encoding

MIT/Apache

15KB
279 lines

hex-noalloc

This is a temporary fork of the hex crate, uploaded to make it usable for other crates that are uploaded to crates.io until #42 is merged.

It is a snapshot of the hex crate, with just that single PR merged. It will be yanked from crates.io once that issue is resolved and a new version of hex is released, at which point users are asked to depend on hex again instead.

Usage, examples, license etc.

Please refer to the original crate for this; other than the addition of the alloc feature merged from #42, all else is unchanged.


lib.rs:

Encoding and decoding hex strings.

For most cases, you can simply use the decode(), encode() and encode_upper() functions. If you need a bit more control, use the traits ToHex and FromHex instead.

Example

extern crate hex;

#[cfg(feature = "std")]
fn main() {
    let hex_string = hex::encode("Hello world!");
    println!("{}", hex_string); // Prints '48656c6c6f20776f726c6421'
}

#[cfg(not(feature = "std"))]
fn main() {
}

No runtime deps

Features