Crates.io | hex-macro |
lib.rs | hex-macro |
version | 0.1.0 |
source | src |
created_at | 2024-06-03 15:25:43.371901 |
updated_at | 2024-06-03 15:25:43.371901 |
description | Adds a hex! macro for compile-time hex decoding |
homepage | |
repository | https://github.com/ozgb/hex-macro |
max_upload_size | |
id | 1260210 |
size | 4,286 |
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");
0x
prefix.Add this to your Cargo.toml
:
[dependencies]
hex-macro = "0.1.0"
This project is licensed under the MIT License.
Contributions are welcome! Please open an issue or submit a pull request on GitHub.