drmvc / password
用于密码处理的库
3.0.0
2018-04-15 10:17 UTC
Requires
- php: ^7.0
Requires (Dev)
- phpunit/phpunit: ^6.0
This package is auto-updated.
Last update: 2024-08-29 04:48:30 UTC
README
DrMVC\Password
用于处理密码散列的小型包装库。
composer require drmvc/password
使用方法
更多示例请见此处。
<?php require_once __DIR__ . '/../vendor/autoload.php'; $obj = new \DrMVC\Password(); // Generate hash from string $hash = $obj->make('some_pass'); // Get info about current hash $info = $obj->info($hash); // Verify if password is valid $verify1 = $obj->verify('some_pass', $hash); // true $verify2 = $obj->verify('other_pass', $hash); // false // Check if rehashing is required $rehash = $obj->rehash($hash); // false
关于PHP单元测试
首先需要通过composer update
安装所有开发依赖项,然后可以从源目录通过./vendor/bin/phpunit
命令手动运行测试。