subtle_encoding/
lib.rs

1//! Encoders and decoders for common data encodings (base64, hex) which avoid
2//! branching or performing table lookups based on their inputs
3//! (a.k.a. "constant time-ish").
4//!
5//! ## Supported Encodings
6//!
7//! - [hex]
8//! - [base64]
9//! - [bech32] (WARNING: preview! Not constant time yet)
10//!
11//! [hex]: https://docs.rs/subtle-encoding/latest/subtle_encoding/hex/index.html
12//! [base64]: https://docs.rs/subtle-encoding/latest/subtle_encoding/base64/index.html
13//! [bech32]: https://docs.rs/subtle-encoding/latest/subtle_encoding/bech32/index.html
14
15#![no_std]
16#![doc(html_root_url = "https://docs.rs/subtle-encoding/0.5.1")]
17#![forbid(unsafe_code)]
18#![warn(missing_docs, rust_2018_idioms, unused_qualifications)]
19
20#[cfg(feature = "alloc")]
21#[macro_use]
22extern crate alloc;
23
24#[cfg(any(feature = "std", test))]
25extern crate std;
26
27#[macro_use]
28mod error;
29
30#[cfg(feature = "base64")]
31pub mod base64;
32#[cfg(feature = "bech32-preview")]
33pub mod bech32;
34pub mod encoding;
35#[cfg(feature = "hex")]
36pub mod hex;
37pub mod identity;
38
39#[cfg(feature = "base64")]
40pub use crate::base64::Base64;
41pub use crate::encoding::Encoding;
42pub use crate::error::Error;
43#[cfg(feature = "hex")]
44pub use crate::hex::Hex;
45pub use crate::identity::{Identity, IDENTITY};