Files
SnowLuma/.pnpm-store/v11/files/cb/ad45518fc657a89f6372b58d52b727a7f520754e4b88066930d081ea3af375bbb166c12f94c112a39fabf5c3eba1631d1f6d5f6bba532a5c52f003d09898e6
T
TanTan 2a69b23b47
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

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)
```