定制 mkopinsky/zxcvbn-php 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mkopinsky/zxcvbn-php

最新稳定版本:4.4.2

Composer 安装命令:

composer require mkopinsky/zxcvbn-php

包简介

Realistic password strength estimation PHP library based on Zxcvbn JS

README 文档

README

Zxcvbn-PHP is a password strength estimator using pattern matching and minimum entropy calculation. Zxcvbn-PHP is based on the the Javascript zxcvbn project from Dropbox and @lowe. "zxcvbn" is bad password, just like "qwerty" and "123456".

zxcvbn attempts to give sound password advice through pattern matching and conservative entropy calculations. It finds 10k common passwords, common American names and surnames, common English words, and common patterns like dates, repeats (aaa), sequences (abcd), and QWERTY patterns.

Build Status Coverage Status Latest Stable Version License

Installation

The library can be installed with Composer by adding it as a dependency to your composer.json file.

{ "require": { "mkopinsky/zxcvbn-php": "^4.4.2" } }

After running php composer.phar update on the command line, include the autoloader in your PHP scripts so that the ZxcvbnPhp class is available.

require_once 'vendor/autoload.php';

Usage

use ZxcvbnPhp\Zxcvbn; $userData = [ 'Marco', 'marco@example.com' ]; $zxcvbn = new Zxcvbn(); $strength = $zxcvbn->passwordStrength('password', $userData); echo $strength['score']; // will print 0 $strength = $zxcvbn->passwordStrength('correct horse battery staple'); echo $strength['score']; // will print 4

Acknowledgements

Thanks to:

统计信息

  • 总下载量: 492.27k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 23
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 23
  • Watchers: 5
  • Forks: 79
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04