vinsaj9 / scrypt
基于 https://github.com/windlace/scrypt 的分支,以支持 PHP 8.1。Scrypt,基于 https://github.com/MPOS/php-mpos/blob/236cccd5d3178e99504bf2665db8bddfed6aa176/include/lib/scrypt.php 的纯 PHP 实现
v1.4
2022-08-23 07:59 UTC
Requires
- php: ^8.1
Requires (Dev)
- phpunit/phpunit: ^9
This package is auto-updated.
Last update: 2024-09-23 12:25:29 UTC
README
为使其支持 PHP 8.1 而 fork自 https://github.com/windlace/scrypt
Scrypt
无扩展的纯 PHP 实现
安装
composer require vinsaj9/scrypt
用法
<?php use function Vinsaj9\Crypto\Scrypt\scrypt; $expected = "77d6576238657b203b19ca42c18a0497f16b4844e3074ae8dfdffa3fede21442fcd0069ded0948f8326a753a0fc81f17e8d3e0fb2e0d3628cf35e20c38d18906"; // strlen($expected) == 128 $actual = bin2hex(scrypt("", "", 16, 1, 1, 64)); // strlen($actual) == 128
基于 https://github.com/cmpscabral/cryptobits/tree/master/php/scrypt。