1
0
Fork
You've already forked fashex
0
No description
  • Rust 99.3%
  • Just 0.7%
2026年06月13日 18:07:24 +08:00
.vscode perf: optimize encoding or decoding small input 2026年06月13日 15:34:51 +08:00
assets perf: optimize encoding or decoding small input 2026年06月13日 15:34:51 +08:00
benches perf: optimize encoding or decoding small input 2026年06月13日 15:34:51 +08:00
fuzz chore: release v0.0.12 2026年06月13日 18:07:24 +08:00
src perf: optimize encoding or decoding small input 2026年06月13日 15:34:51 +08:00
.gitignore chore: add Justfile 2026年03月08日 00:36:27 +08:00
BENCHMARK.md perf: optimize encoding or decoding small input 2026年06月13日 15:34:51 +08:00
Cargo.lock chore: release v0.0.12 2026年06月13日 18:07:24 +08:00
Cargo.toml chore: release v0.0.12 2026年06月13日 18:07:24 +08:00
Cross.toml feat: fashex (encode and decode) 2026年03月03日 20:38:20 +08:00
Justfile perf: optimize encoding or decoding small input 2026年06月13日 15:34:51 +08:00
LICENSE-APACHE feat: fashex (encode and decode) 2026年03月03日 20:38:20 +08:00
LICENSE-MIT feat: fashex (encode and decode) 2026年03月03日 20:38:20 +08:00
README.md chore: release v0.0.12 2026年06月13日 18:07:24 +08:00
rustfmt.toml feat: fashex (encode and decode) 2026年03月03日 20:38:20 +08:00

fashex - fast hexadecimal encoding and decoding

crates.io docs.rs license

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

Highlights

  • Best-effort SIMD acceleration.
  • Small, focused public APIs.

Performance

This crate is comparable in performance to hex-simd, slightly better than const-hex, and far superior to faster-hex.

For benchmark results, please refer to BENCHMARK.md.

Usage

Adds fashex as a dependency in your Cargo.toml:

[dependencies]
fashex = "*" # Please specify the latest version instead of "*"!

For detailed usage instructions, please refer to the documentation.

Features

  • alloc (default)

    Enables Rust alloc crate support.

  • std (default)

    Enables Rust standard library support.

  • nightly

    Enables features that require nightly Rust.

  • portable-simd

    Enables portable SIMD acceleration support via unstable core::simd, which may help improve performance on platforms other than x86, x86_64, aarch64 (arm64ec), loongarch32 and loongarch64.

    Notes: this requires nightly Rust.

  • experimental-loongarch-simd

    Enables experimental SIMD acceleration via Loongson SIMD eXtention or Loongson Advanced SIMD eXtention.

    Notes: this requires nightly Rust.

  • runtime-cpu-detection (default)

    Enables CPU features detection at runtime.

no_std support

This crate is no_std-friendly, just disable the default features:

[dependencies]
fashex = { version = "*", default-features = false, features = [] } # Please specify the latest version instead of "*"!

Some notes:

  1. You will probably need to enable "alloc" feature manually.
  2. OS-independent no_std-friendly CPU features detection is only supported on x86 and x86_64 platforms. On other platforms, runtime-cpu-detection does nothing when "std" feature is disabled.

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.
  2. The SIMD-accelerated code paths for aarch64 architecture are tested and fuzzed.
  3. The SIMD-accelerated code paths for loongarch64 / loongarch32 architecture are cross-tested, but not extensively fuzzed.

If you find any bugs, please report them.

Acknowledgements

This crate is inspired by the following repositories:

  • hex-simd, SPDX-License-Identifier: MIT
  • const-hex, SPDX-License-Identifier: MIT OR Apache-2.0
  • faster-hex, SPDX-License-Identifier: MIT OR Apache-2.0

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
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.