bmutinda/hashing

PHP 哈希库集合

1.0 2017-06-08 10:43 UTC

This package is not auto-updated.

Last update: 2024-09-29 02:18:44 UTC


README

安装

composer require bmutinda/hashing

加密(创建哈希字符串)

$bcrypt = new \Bmutinda\Hashing\Bcrypt();
$hashed = $bcrypt->hash($password);

比较哈希与普通字符串

$bcrypt = new \Bmutinda\Hashing\Bcrypt();
$password = "My plain password";
$hashedPassword = "Long hashed string";
$isValid = $bcrypt->verify($password, $hashedPassword)

运行测试

从项目根目录中的终端运行此命令

vendor/bin/phpunit tests/