UNPKG

@wcj/generate-password

Version:

Generate Password is a generating random and unique passwords.

34 lines (33 loc) 1.17 kB
export declare const LOWERCASE = "abcdefghijklmnopqrstuvwxyz"; export declare const UPPERCASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; export declare const NUMERIC = "0123456789"; export declare const SPECIAL_CHARACTER = "!@#$%^&*()_+~`|}{\\[\\]:;?>,.<-=\\/"; export type Option = { /** * Integer, length of password. * @default 10 */ length?: number; /** Boolean, put lowercase in password */ lowerCase?: boolean; /** Boolean, use uppercase letters in password. */ upperCase?: boolean; /** Boolean, put numbers in password. */ numeric?: boolean; /** Special characters */ special?: boolean; }; /** Create a random password */ export declare function generate(opts?: Option): string; /** Create a random set of passwords */ export declare function generateMultiple(length?: number, opts?: Option): string[]; /** * symbols pass with lowercase and uppercase letters, numbers and special characters * @return [0~4] * * `4` Strong :) Now it's safe! * `3` Medium level. Enter more symbols! * `2` Very Weak! It's easy to crack! * `1` It's easy to crack! */ export declare function validate(password?: string): number;