MCPcopy Index your code
hub / github.com/simstudioai/sim / encodeOTPValue

Function encodeOTPValue

apps/sim/lib/core/security/otp.ts:62–64  ·  view source on GitHub ↗

* OTP values are stored as `"code:attempts"` (e.g. `"654321:0"`). * This keeps the attempt counter in the same key/row as the OTP itself.

(otp: string, attempts: number)

Source from the content-addressed store, hash-verified

60 * This keeps the attempt counter in the same key/row as the OTP itself.
61 */
62function encodeOTPValue(otp: string, attempts: number): string {
63 return `${otp}:${attempts}`
64}
65
66export function decodeOTPValue(value: string): { otp: string; attempts: number } {
67 const lastColon = value.lastIndexOf(':')

Callers 2

storeOTPFunction · 0.85
incrementOTPAttemptsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected