Registry / utility / hex-literal

hex-literal

JSON →
library1.1.0rscratesunverified

A macro for converting hexadecimal string literals to a byte array at compile time.

# Cargo.toml [dependencies] hex-literal = "1.1.0"
INSTALL
IMPORT
SIG · HEX-LITERAL
H
hex-literal
utilityrustv1.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

hex
use hex_literal::hex;

Converts a hex string literal to a byte array at compile time.

use hex_literal::hex; fn main() { let bytes = hex!("48656c6c6f"); assert_eq!(bytes, [0x48, 0x65, 0x6c, 0x6c, 0x6f]); }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.1.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
12
Resources
hex-literal — cargo add hex-literal · libregistry