hex-macro 0.1.0

Adds a hex! macro for compile-time hex decoding
Documentation
  • Coverage
  • 50%
    1 out of 2 items documented1 out of 1 items with examples
  • Size
  • Source code size: 5.1 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 275.8 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 4s Average build duration of successful builds.
  • all releases: 4s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • ozgb/hex-macro
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ozgb

hex-macro

Crates.io Documentation License

hex-macro is a Rust crate that provides a hex! macro for compile-time hex decoding.

use hex_macro::hex;

pub const DATA: [u8; 11] = hex!("0x48656c6c6f20776f726c64"); // Also works without the '0x' prefix
assert_eq!(DATA, *b"Hello world");

Features

  • Decodes hex strings into byte arrays at compile time.
  • Supports hex strings with and without the 0x prefix.

Installation

Add this to your Cargo.toml:

[dependencies]
hex-macro = "0.1.0"

TODO

  • Add support for other decoding backends using feature flags

License

This project is licensed under the MIT License.

Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.