UNPKG

otp-io

Version:

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

28 lines (27 loc) • 562 B
import type { RandomBytes } from "./crypto/random"; import { SecretKey } from "./key"; /** * * * @export * @param {RandomBytes} random * @param {number} [size=10] * @return {Promise<SecretKey>} */ export declare function generateKey(random: RandomBytes, size?: number): SecretKey; /** * * * @export * @param {string} base32text * @return {SecretKey} */ export declare function importKey(base32text: string): SecretKey; /** * * * @export * @param {SecretKey} key * @return {string} */ export declare function exportKey(key: SecretKey): string;