Skip to main content

codlet_core/code/
mod.rs

1//! One-time code policy, generation, normalization, and validation (RFC-003).
2//!
3//! The four representations of a code are kept distinct (RFC-003 ยง11.2):
4//! generated plaintext and user input are [`crate::secret::PlainCode`] /
5//! normalized `String` (secret, never persisted); the persisted value is a
6//! [`crate::hashing::LookupKey`] derived in the [`crate::hashing`] module.
7
8pub mod alphabet;
9pub mod generate;
10pub mod normalize;
11pub mod policy;
12
13pub use alphabet::{Alphabet, DEFAULT_ALPHABET};
14pub use generate::{generate_code, validate_code_input};
15pub use normalize::normalize;
16pub use policy::{CodePolicy, DEFAULT_MAX_RAW_LEN, LEGACY_CIAO_LENGTH, SECURE_MIN_HUMAN_LENGTH};