Archive: Namaste PHP AMQP framework v1.0 (2017-2020)
952 days continuous production uptime, 40k+ tp/s single node. Original corpo Bitbucket history not included — clean archive commit.
This commit is contained in:
31
stubs/testPasswords.php
Normal file
31
stubs/testPasswords.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
require_once(dirname(__DIR__) . '/config/sneakerstrap.inc');
|
||||
|
||||
$x = md5('einstein'); // this will hash to the same value every time
|
||||
echo 'md5: ' . $x . PHP_EOL;
|
||||
$y = password_hash($x, PASSWORD_ARGON2I); // this hashes differently every time b/c the salt is auto generated
|
||||
echo PHP_EOL . 'hash: ' . PHP_EOL;
|
||||
echo $y . PHP_EOL;
|
||||
if (password_verify($x, $y))
|
||||
echo 'passwords match' . PHP_EOL;
|
||||
else
|
||||
echo 'Passwords do not match' . PHP_EOL;
|
||||
|
||||
$email = 'captain@serenity.space';
|
||||
$token = '10F00599-F8DA-ADF3-7033-7A1CACF2879D';
|
||||
$meta = [
|
||||
META_TEMPLATE => TEMPLATE_CLASS_USERS,
|
||||
META_CLIENT => CLIENT_API_USER,
|
||||
META_DO_CACHE => 0,
|
||||
CLIENT_AUTH_TOKEN => '136EA67A-B1E2-0A4B-2BD8-EE34D39DFDE1',
|
||||
META_EVENT_GUID => guid(),
|
||||
|
||||
];
|
||||
$obj = new gacUsers($meta);
|
||||
if (!$obj->status)
|
||||
exit(ERROR_TEMPLATE_INSTANTIATE . TEMPLATE_CLASS_USERS);
|
||||
|
||||
$results = $obj->hashCheck($email, $x);
|
||||
echo PHP_EOL;
|
||||
var_export($results);
|
||||
echo PHP_EOL;
|
||||
Reference in New Issue
Block a user