@colingreybosh/otp-lib
Version:
A TypeScript library for generating, validating, and managing one-time passwords (OTP) for authentication purposes.
15 lines • 565 B
TypeScript
import type { OTPResult, TOTPConfig, ValidationResult } from '../types';
export declare class TOTP {
private readonly config;
constructor(config: TOTPConfig);
generate(timestamp?: number): OTPResult;
validate(token: string, timestamp?: number, window?: number): ValidationResult;
getCurrentTimeStep(timestamp?: number): number;
private validateConfig;
private generateToken;
private createTimeBuffer;
private generateHMAC;
private performDynamicTruncation;
private constantTimeEquals;
}
//# sourceMappingURL=totp.d.ts.map