totpChecker.d.ts 899 B

1234567891011121314151617181920212223
  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. secret?: string;
  9. issuer: string;
  10. }
  11. export interface ToTpSecretAndUrl {
  12. url: string;
  13. secret: string;
  14. }
  15. export declare class TotpChecker {
  16. static ValidateTotp(totpSecret: string | null, code: string | undefined, period?: number, digits?: number, algorithm?: TotpAlgorithm): boolean;
  17. private static DoGenerateCode;
  18. private static getCurrentPeriod;
  19. static GenerateCode(totpSecret: string, period?: number, digits?: number, algorithm?: TotpAlgorithm): string;
  20. static GenerateSecret(secretLength?: number): string;
  21. static GenerateUrl(optionsOrIssuer: ToTpGeneratorOptions | string): ToTpSecretAndUrl;
  22. }
  23. //# sourceMappingURL=totpChecker.d.ts.map