Dev Build / cleanup (push) Canceled after 0s
Dev Build / typecheck (push) Canceled after 0s
Dev Build / build (linux-arm64, ubuntu-24.04-arm, linux-arm64) (push) Canceled after 0s
Dev Build / build (linux-x64, ubuntu-latest, linux-x64) (push) Canceled after 0s
Dev Build / build (win-x64, windows-latest, win32-x64) (push) Canceled after 0s
Dev Build / dispatch-dev-docker (push) Canceled after 0s
38 lines
1.1 KiB
Plaintext
38 lines
1.1 KiB
Plaintext
# zxcvbn-ts
|
|
|
|
**zxcvbn** is a password strength estimator inspired by password crackers.
|
|
It recognizes and analyzes over 40 thousand common passwords using pattern matching and conservative estimation and
|
|
filters out common first names, last names, popular words from Wikipedia and common words in many cultures,
|
|
and recognizes common patterns like dates, repetitions (e.g. 'aaa'), sequences (e.g. 'abcd'), keyboard smashes (e.g. 'qwertyuiop'), and l33t speak.
|
|
|
|
## Installation
|
|
|
|
#### npm:
|
|
|
|
`npm install @zxcvbn-ts/core @zxcvbn-ts/language-common --save`
|
|
|
|
#### yarn:
|
|
|
|
`yarn add @zxcvbn-ts/core @zxcvbn-ts/language-common`
|
|
|
|
## Setup
|
|
|
|
```js
|
|
import { ZxcvbnFactory } from '@zxcvbn-ts/core'
|
|
import * as zxcvbnCommonPackage from '@zxcvbn-ts/language-common'
|
|
import * as zxcvbnEnPackage from '@zxcvbn-ts/language-en'
|
|
|
|
const options = {
|
|
dictionary: {
|
|
...zxcvbnCommonPackage.dictionary,
|
|
...zxcvbnEnPackage.dictionary,
|
|
},
|
|
graphs: zxcvbnCommonPackage.adjacencyGraphs,
|
|
translations: zxcvbnEnPackage.translations,
|
|
}
|
|
const zxcvbn = new ZxcvbnFactory(options)
|
|
|
|
const password = 'somePassword'
|
|
zxcvbn.check(password)
|
|
```
|