elubilu/password-meter

密码计分器受到密码熵指针对点系统(Password Entropy Pointing System)的启发,其主要目的是帮助最终用户拥有更强大的密码。(密码熵是衡量密码不可预测性的指标。)

1.0.2 2020-05-20 17:24 UTC

This package is auto-updated.

Last update: 2024-09-21 03:20:18 UTC


README

密码计分器受到密码熵指针对点系统的启发,其主要目的是帮助最终用户拥有更强大的密码。(密码熵是衡量密码不可预测性的指标。)

安装

使用包管理器composer来安装密码计分器

composer require elubilu/password-meter

使用方法

在您的应用程序上配置它非常简单,只需按照以下步骤操作

<?php
$app =  new passwordMeter\passwordMeter();
$app->password_strength("1111"); // return  message = "Very Weak" , strength = 14  , percentage = 11%
$app->password_strength("aaaa"); // return  message = "Very Weak" , strength = 19 , percentage = 15%
$app->password_strength("####"); // return  message = "Very Weak" , strength = 21 , percentage = 17%
$app->password_strength("banglad"); // return  message = "Weak" , strength = 33  , percentage = 26%
$app->password_strength("bangla1"); // return  message = "Good" , strength = 37  , percentage = 29%
$app->password_strength("bangladesh"); // return  message = "Good" , strength = 48  , percentage = 38%
$app->password_strength("bangla1desh"); // return  message = "Good" , strength = 57 , percentage = 45%
$app->password_strength("Bangla1desh"); // return  message = "Strong", strength = 66, percentage = 52%
$app->password_strength("Bangladesh#"); // return  message = "Strong", strength = 71, percentage = 56%
$app->password_strength("Bangla1desh#"); // return  message = "Strong", strength = 79, percentage = 62%
$app->password_strength("Hello71*Bangla1desh#"); // return  message = "Very Strong" , strength = 132  , percentage = 100%

有一些默认消息

<?php
$app =  new passwordMeter\passwordMeter();
$app->get_messages();
// Example: default messages of package, 
Array
(
    [VERY_WEAK] => Very Weak
    [WEAK] => Weak
    [GOOD] => Good
    [STRONG] => Strong
    [VERY_STRONG] => Very Strong
)

有一些默认配置

<?php
$app =  new passwordMeter\passwordMeter();
$app->get_configs();
// Example: default configs of package, 
Array
(
    [SMALL_LETTER] => Array
        (
            [min] => 0
            [max] => 26
        )

    [CAPITAL_LETTER] => Array
        (
            [min] => 0
            [max] => 26
        )

    [NUMERIC] => Array
        (
            [min] => 0
            [max] => 255
        )

    [SPECIAL_CHAR] => Array
        (
            [min] => 0
            [max] => 33
        )

)

贡献

欢迎拉取请求。对于任何更改,请首先提交一个问题来讨论您希望进行的更改。

请确保根据需要更新测试。

许可协议

MIT