Skip to main content

base64_ng/v2/web/
mod.rs

1//! Exact WHATWG forgiving Base64 decoding for ordinary web-compatible input.
2//!
3//! [`FORGIVING`] follows the WHATWG Infra Standard algorithm: it removes
4//! ASCII whitespace, accepts omitted canonical padding, rejects impossible
5//! lengths and non-Standard symbols, and discards unused trailing bits.
6//! This is deliberately separate from strict RFC 4648 and `secret::*` APIs.
7//! It is not a constant-time or zeroizing interface.
8
9mod decoder;
10mod one_shot;
11#[cfg(feature = "alloc")]
12mod one_shot_alloc;
13
14pub use decoder::{ForgivingDecoder, ForgivingError};
15
16/// Exact WHATWG forgiving Base64 decoder.
17#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
18pub struct ForgivingBase64;
19
20/// Exact WHATWG forgiving Base64 decoder.
21pub const FORGIVING: ForgivingBase64 = ForgivingBase64;