totpChecker.d.ts 829 B

123456789101112131415161718192021
  1. export type TotpAlgorithm = "SHA-1" | "SHA-256" | "SHA-512";
  2. export interface ToTpGeneratorOptions {
  3. digits?: number;
  4. period?: number;
  5. algorithm?: TotpAlgorithm;
  6. label?: string;
  7. secretLength?: number;
  8. issuer: string;
  9. }
  10. export interface ToTpSecretAndUrl {
  11. url: string;
  12. secret: string;
  13. }
  14. export declare class TotpChecker {
  15. static ValidateTotp(totpSecret: string | null, code: string | undefined, period?: number, digits?: number, algorithm?: TotpAlgorithm): Promise<boolean>;
  16. private static DoGenerateCode;
  17. private static getCurrentPeriod;
  18. static GenerateCode(totpSecret: string, period?: number, digits?: number, algorithm?: TotpAlgorithm): string;
  19. static GenerateUrl(optionsOrIssuer: ToTpGeneratorOptions | string): ToTpSecretAndUrl;
  20. }
  21. //# sourceMappingURL=totpChecker.d.ts.map