CodeGenerator class provides static utilities for generating, validating, and normalizing action codes and prefixes in the Action Codes Protocol. It ensures codes are deterministic, secure, and conform to protocol standards.
Constants
TIME_WINDOW_MS: Code validity window in milliseconds (default: protocol TTL)CODE_DIGITS: Number of digits in the code (default: 8)MIN_PREFIX_LENGTH: Minimum allowed prefix lengthMAX_PREFIX_LENGTH: Maximum allowed prefix length
Static Methods
validatePrefix
true if valid, false otherwise.
validateCodeFormat
true if valid.
validateCodeDigits
true if valid.