$ const-hex
v1.18.0MAJOR UPDATEFast byte array to hex string conversion
Latest Update Summary
Crate
Name: const-hex New version: 1.18.0 Release date: 2026-02-25T08:56:06.345588Z
Crate readme
Short description This crate provides a fast conversion of byte arrays to hexadecimal strings, both at compile time, and at run time.
Long description
It aims to be a drop-in replacement for the hex crate, and extends the API with const-eval, a const-generics formatting buffer, and more. This crate offers performance comparable to faster-hex on x86/x86-64 but outperforms it on other platforms, and is significantly faster than hex in encoding and decoding.
Features
• Drop-in replacement for hex
• const-eval support
• const-generics formatting buffer
• Performance outperforming faster-hex on non-x86 architectures
• Designed for rustc 1.64+
Code Examples Basic usage
use const_hex::const_encode;
let hex = const_encode!(b"hello");
Add to Cargo.toml
[dependencies]
const-hex = "<version>"
Links • https://crates.io/crates/const-hex • https://docs.rs/const-hex • https://github.com/danipopes/const-hex
Release info
Release version: N/A
Release description N/A
Code Examples N/A
Minor update: 1.17.0 → 1.18.0
$ DOWNLOADS TREND
$ VERSION HISTORY
$ LINKS
$ INSTALL
cargo add const-hexOr add to Cargo.toml: const-hex = "1.18.0"