UNPKG

otp-io

Version:

🕖 Typed library to work 2fa via Google Authenticator/Time-based TOTP/Hmac-based HOTP

32 lines (31 loc) • 756 B
import { HmacAlgorithm } from "./crypto/hmac"; import { SecretKey } from "./key"; export type HOTPOptions = { /** * Secret key */ secret: SecretKey; /** * Incrementing counter. From 0 to Number.MAX_SAFE_INTEGER (53 bits) */ counter: number; /** * Count of digits. * - Any other than `6` is not supported by Google Authenticator * @default 6 */ digits?: number; /** * Hash algorithms for generating new codes. * - Any other than `sha1` is not supported by Google Authenticator * @default "sha1" */ algorithm?: HmacAlgorithm; }; /** * * * @export * @return {*} {Required<HOTPOptions>} */ export declare function getDefaultHOTPOptions(): Required<HOTPOptions>;