- password_hash: documentation ( source)
- crypt: documentation ( source)
- md5: documentation ( source)
<?php
$salt = md5('static salt');
echo "SALT: " . $salt . PHP_EOL;
for ($i = 0; $i < 5; $i++) {
echo "PASSWORD HASH: " . password_hash('reddit is fun', PASSWORD_DEFAULT, ['salt' => $salt, 'cost' => 4]) . PHP_EOL;
}
if (CRYPT_BLOWFISH == 1) {
for ($i = 0; $i < 5; $i++) {
echo "CRYPT BLOWFISH: " . crypt('reddit is fun', '$2a$04$' . $salt . '$') . PHP_EOL;
}
}