1.0.4 • Published 8 months ago
@kaffee/mazagran v1.0.4
@kaffee/mazagran
Enhance password strength
Support
- The length and whether the password is in the specified character set
- The ability of password characters to be logically adjacent, such as aBc, abC, etc.
- The ability to be adjacent to the physical position of the password character keyboard, including the adjacent horizontal and left and right slash directions, such as qwer 1qaz 0okm, etc.
- Ability to see if a password is present in a weak password pool
- Adjacent single character repeated multiple times
- The password should be a combination of English letters (case sensitive) + numbers + special characters
- Password maximum and minimum length
- Password special character set
Installation
Install with npm
npm install --dev @kaffee/mazagranInstall with yarn
yarn add --dev @kaffee/mazagranInstall with pnpm
pnpm add -D @kaffee/mazagranOnline Demo
Usage/Examples
Base Usage
const mazagran = new Mazagran();
mazagran.checkAll("password") // return err dictConfig
| check type | description |
|---|---|
| PASSWORD_LENGTH | check password length |
| CONTAIN_DIGIT | check password contains numbers |
| CASE | check password contains case |
| LOWER_CASE | check password contains lower case |
| UPPER_CASE | check password contains upper case |
| SPECIAL_CHAR | check password contains special char |
| HORIZONTAL_KEY_SEQUENTIAL | check password contains horizontal keyboard key |
| SLANT_KEY_SEQUENTIAL | check password contains slant keyboard key |
| LOGIC_SEQUENTIAL | check password contains logic char |
| SEQUENTIAL_CHAR_SAME | check password contains same char |