@hixbe/otp-pass-kit
Version:
A secure, cryptographically-strong OTP and password generator for Node.js with CLI support. Generate customizable one-time passwords and strong passwords with TypeScript support.
27 lines (24 loc) • 968 B
text/typescript
type Options = {
lowerCaseAlphabets?: boolean;
upperCaseAlphabets?: boolean;
specialChars?: boolean;
digits?: boolean;
ensureEachType?: boolean;
};
/**
* Generates a One-Time Password (OTP) with customizable options.
* @param length - The length of the OTP (default: 6)
* @param options - Options for character sets to include
* @returns A randomly generated OTP string
* @throws Error if length is invalid or no character sets are enabled
*/
declare function generateOtp(length?: number, options?: Options): string;
/**
* Generates a password with customizable options.
* @param length - The length of the password (default: 8)
* @param options - Options for character sets to include
* @returns A randomly generated password string
* @throws Error if length is invalid or no character sets are enabled
*/
declare function generatePass(length?: number, options?: Options): string;
export { type Options, generateOtp, generatePass };