UNPKG

react-native-nitro-totp

Version:

React Native module for TOTP (Time-based One-Time Password) and HOTP (HMAC-based One-Time Password) authentication.

31 lines 1.19 kB
import type { BaseGenerateOptions } from './types'; /** * Checks if the given OTP (One-Time Password) has a valid format. * * @param {string} otp - The OTP to check. * @param {GenerateOptions} [options=defaultOptions] - The options for OTP generation (optional). * @returns {boolean} True if the OTP format is valid, false otherwise. */ export declare const isValidOTP: (otp: string, options: BaseGenerateOptions) => boolean; /** * Formats the secret key for display by inserting hyphens every 4 characters. * * @param {string} secretKey - The secret key to format. * @returns {string} The formatted secret key. */ export declare const formatSecretKey: (secretKey: string) => string; /** * Formats an OTP (One-Time Password) by grouping digits for readability. * * @param {string} otp - The OTP to format. * @returns {string} The formatted OTP. */ export declare const formatOTP: (otp: string) => string; /** * Parses the secret key by removing any hyphens from it. * * @param {string} secretKey - The secret key to parse. * @returns {string} The parsed secret key. */ export declare const parseSecretKey: (secretKey: string) => string; //# sourceMappingURL=utils.d.ts.map