fashex 0.0.6

Hexadecimal string encoding and decoding with best-effort SIMD acceleration.
Documentation
# fashex - fast hexadecimal encoding and decoding

[![crates.io][crates-badge]][crates-url]
[![docs.rs][docs-badge]][docs-url]
[![license][license-badge]][license-url]

[crates-badge]: https://img.shields.io/crates/v/fashex
[crates-url]: https://crates.io/crates/fashex
[docs-badge]: https://docs.rs/fashex/badge.svg
[docs-url]: https://docs.rs/fashex
[license-badge]: https://img.shields.io/crates/l/fashex
[license-url]: https://codeberg.org/Hanyu/fashex/src/branch/main/LICENSE-APACHE

Hexadecimal string encoding and decoding with best-effort SIMD acceleration.

## Highlights

- Best-effort SIMD acceleration.
- Small, focused public APIs.
- APIs that work in const contexts.
- Unlike crates `const-hex`, `faster-hex`, etc., this crate accepts uninitialized output buffers (`MaybeUninit<u8>`).

## Performance

This crate offers performance comparable to `const-hex` or `hex-simd` on x86 / x86_64 architectures.

The following benchmarks were conducted on an AMD Ryzen 7 8845HS CPU, compiled with `rustc 1.96.0-nightly (2972b5e59 2026-04-03)` on `x86_64-unknown-linux-gnu`. You can run these benchmarks locally with `RUSTFLAGS='-C target-cpu=x86-64-v4' cargo bench` (assuming that your CPU supports the `x86-64-v4` target, i.e., with basic AVX-512 support).

<div style="display: flex; gap: 20px;">
  <div style="flex: 1;">
    <img src="./assets/bench-decoding.svg" alt="bench-decoding">
  </div>
  <div style="flex: 1;">
    <img src="./assets/bench-encoding.svg" alt="bench-encoding">
  </div>
</div>

## Disclaimer

Although all tests are passing and hours of fuzzing show no failures, latent bugs may still exist in the code.

1. The SIMD-accelerated code paths for `x86` / `x86_64` architecture are well tested and fuzzed.
1. The SIMD-accelerated code paths for `aarch64` architecture are tested and fuzzed.
1. The SIMD-accelerated code paths for `loongarch64` architecture have not been tested or fuzzed on real hardware.

If you find any bugs, please report them.

## Acknowledgements

This crate is inspired by the following repositories:

- [`const-hex`]https://github.com/DaniPopes/const-hex, SPDX-License-Identifier: MIT OR Apache-2.0
- [`hex-simd`]https://github.com/Nugine/simd, SPDX-License-Identifier: MIT
- [`faster-hex`]https://github.com/nervosnetwork/faster-hex, SPDX-License-Identifier: MIT OR Apache-2.0

#### License

<sup>
Licensed under either of <a href="./LICENSE-APACHE">Apache License, Version
2.0</a> or <a href="./LICENSE-MIT">MIT license</a> at your option.
</sup>

<br>

<sub>
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in these crates by you, as defined in the Apache-2.0 license,
shall be dual licensed as above, without any additional terms or conditions.
</sub>