Skip to main content

Crate fashex

Crate fashex 

Source
Expand description

§fashex - fast hexadecimal string formatting

Crates.io Documentation License

§Features

  • Precise public APIs (encode or decode).
  • Best-effort SIMD acceleration.
  • APIs that works in const contexts.
  • Unlike crates const-hex, faster-hex, etc., this crate does not require initialization of the output buffer.

§Roadmap to 1.0

Theoretically, the current version of this crate is already stable and ready for production use: the core APIs are unlikely to change, and all tests are passing. However, there’re still some questions:

  1. Does it worth a feature flag disabling SIMD acceleration? If so, should it be enabled by default?

    Currently, we don’t have such feature flag and SIMD acceleration is enabled by default.

  2. Does it worth a feature flag enabling runtime CPU features detection? If so, should it be enabled by default?

    Currently, we don’t have such feature flag and runtime CPU features detection is enabled by default.

§Disclaimer

Although all tests are passing and hours of fuzz tests show no failures, there may still be bugs lurking in the code. If you find any bugs, please report them.

§Acknowledgements

This crate is highly inspired by the following repositories:

  • const-hex, SPDX-License-Identifier: MIT OR Apache-2.0
  • faster-hex, SPDX-License-Identifier: MIT OR Apache-2.0
  • hex-simd, SPDX-License-Identifier: MIT
§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.

Modules§

error
Errors
util
Utilities

Macros§

decode
Helper macro for decoding hexadecimal string in const contexts.
encode
Helper macro for encoding hexadecimal string in const contexts.

Functions§

decode
Decodes the input hexadecimal string to bytes and writes it to the output buffer.
decode_generic
decode(), but const-evaluable at the cost of performance.
encode
Encodes the input bytes to hexadecimal string and writes it to the output buffer.
encode_generic
encode() or decode(), but const-evaluable at the cost of performance.