Std.App.Totp
10 public declarations
- config
Bytes -> Str -> Str -> Std.App.Totp.TotpConfigInitializes standard TOTP configuration with 6 digits, 30-second interval, and 1-step skew tolerance.
- Configuring
The three numbers a code's shape is decided by, set one call at a time.
- decodeBase32
Str -> Result[Bytes, Str]RFC 4648 Base32 decoder with whitespace stripping and case normalization.
- encodeBase32
&Bytes -> StrRFC 4648 Base32 encoder converting binary secrets into uppercase strings without padding.
- generate
&Std.App.Totp.TotpConfig -> Int -> StrComputes the canonical time-based OTP code for the given epoch timestamp using HMAC-SHA256.
- provisioningUri
&Std.App.Totp.TotpConfig -> StrBuilds the standard otpauth URI for authenticator app enrollment.
- state
Std.App.Totp.TotpStateConstructs replay prevention tracking state.
- TotpConfig
Immutable parameters for RFC 6238 TOTP generation and validation.
- TotpState
Stateful replay prevention tracking the highest authenticated time counter step.
- verify
&Std.App.Totp.TotpConfig -> &Std.App.Totp.TotpState -> Str -> Int -> BoolValidates a user-submitted code against all allowed steps in [C - skew, C + skew]
