@zxcvbn-ts/core

Realistic password strength estimation written in typescript

Usage no npm install needed!

<script type="module">
  import zxcvbnTsCore from 'https://cdn.skypack.dev/@zxcvbn-ts/core';
</script>

README

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

import { zxcvbn, ZxcvbnOptions } from '@zxcvbn-ts/core'
import zxcvbnCommonPackage from '@zxcvbn-ts/language-common'
import zxcvbnEnPackage from '@zxcvbn-ts/language-en'

const password = 'somePassword'
const options = {
  dictionary: {
    ...zxcvbnCommonPackage.dictionary,
    ...zxcvbnEnPackage.dictionary,
  },
  translations: zxcvbnEnPackage.translations,
}
ZxcvbnOptions.setOptions(options)

zxcvbn(password)