codec_base64url/lib.rs
1// SPDX-FileCopyrightText: 2026 ReallyMe LLC
2//
3// SPDX-License-Identifier: MIT OR Apache-2.0
4
5//! URL-safe base64 without padding (RFC 4648 ยง5), rejecting non-canonical trailing bits.
6
7mod decode;
8mod encode;
9mod error;
10/// Serde adapter for required byte fields encoded as unpadded base64url strings.
11#[cfg(feature = "serde")]
12pub mod serde_bytes;
13/// Serde adapter for optional byte fields encoded as unpadded base64url strings.
14#[cfg(feature = "serde")]
15pub mod serde_option_bytes;
16
17pub use decode::{base64url_bytes_to_bytes, base64url_to_bytes};
18/// Maximum accepted encoded base64url text length.
19pub const MAX_BASE64URL_INPUT_LEN: usize = 2 * 1024 * 1024;
20pub use encode::bytes_to_base64url;
21pub use error::Base64UrlError;