Skip to main content

base64_ng_multibase/
lib.rs

1#![cfg_attr(not(feature = "std"), no_std)]
2#![deny(unsafe_code)]
3#![deny(missing_docs)]
4#![deny(clippy::all)]
5#![deny(clippy::pedantic)]
6
7//! Optional `simd` and `checked-backend` features forward to the core's ordinary
8//! kernels without changing defaults or grammar. `checked-backend` implies
9//! `simd`; neither enables `std`, `alloc` or `secrets` on its own. Eligible
10//! sizes and CPU/build capabilities still govern acceleration. Secret/CT paths
11//! remain separate. Without core `std`, complete static ISA features are required.
12
13//! Bounded support for the registered Base64-family multibase encodings.
14//!
15//! This crate implements only `base64` (`m`), `base64pad` (`M`), `base64url`
16//! (`u`), and `base64urlpad` (`U`) from the pinned multibase registry. It is
17//! not a complete multibase implementation and rejects every other prefix.
18//! All decoding is strict and canonical for the prefix-selected RFC 4648
19//! alphabet and padding policy.
20
21#[cfg(feature = "alloc")]
22extern crate alloc;
23
24#[cfg(feature = "alloc")]
25mod alloc_api;
26mod encoding;
27mod error;
28mod incremental;
29mod limits;
30mod one_shot;
31mod types;
32
33#[cfg(feature = "alloc")]
34pub use alloc_api::{decode_base64_multibase_to_vec, encode_base64_multibase_to_string};
35pub use encoding::{Base64MultibaseEncoding, MultibaseRegistryStatus};
36pub use error::{Base64MultibaseError, Base64MultibaseErrorKind};
37pub use incremental::{Base64MultibaseDecoder, Base64MultibaseEncoder};
38pub use limits::Base64MultibaseLimits;
39pub use one_shot::{
40    base64_multibase_encoded_len, decode_base64_multibase_into, encode_base64_multibase_into,
41    validate_base64_multibase,
42};
43#[cfg(feature = "alloc")]
44pub use types::DecodedBase64MultibaseVec;
45pub use types::{Base64MultibaseStatus, Base64MultibaseStep, DecodedBase64Multibase};