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.
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 lengthtrue
if valid, false
otherwise.
true
if valid.
true
if valid.