1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! Encoders and decoders for common data encodings (base64, hex) which avoid
//! branching or performing table lookups based on their inputs
//! (a.k.a. "constant time-ish").
//!
//! ## Supported Encodings
//!
//! - [hex]
//! - [base64]
//! - [bech32] (WARNING: preview! Not constant time yet)
//!
//! [hex]: https://docs.rs/subtle-encoding/latest/subtle_encoding/hex/index.html
//! [base64]: https://docs.rs/subtle-encoding/latest/subtle_encoding/base64/index.html
//! [bech32]: https://docs.rs/subtle-encoding/0.2.3/subtle_encoding/bech32/index.html

#![no_std]
#![deny(warnings, missing_docs, unused_import_braces, unused_qualifications)]
#![forbid(unsafe_code)]
#![doc(html_root_url = "https://docs.rs/subtle-encoding/0.3.7")]

#[cfg(all(feature = "alloc", not(feature = "std")))]
#[allow(unused_imports)] // rustc bug?
#[macro_use]
extern crate alloc;

#[cfg(any(feature = "std", test))]
#[macro_use]
extern crate std;

extern crate failure;
#[macro_use]
extern crate failure_derive;
#[cfg(feature = "zeroize")]
extern crate zeroize;

#[macro_use]
mod error;

#[cfg(feature = "base64")]
pub mod base64;
#[cfg(feature = "bech32-preview")]
pub mod bech32;
pub mod encoding;
#[cfg(feature = "hex")]
pub mod hex;
pub mod identity;
mod prelude;

#[cfg(feature = "base64")]
pub use crate::base64::Base64;
pub use crate::encoding::Encoding;
pub use crate::error::Error;
#[cfg(feature = "hex")]
pub use crate::hex::Hex;
pub use crate::identity::{Identity, IDENTITY};