PHP Hash code example
Example 1: hash a password php
password_hash("MySuperSafePassword!", PASSWORD_DEFAULT)
password_verify("MySuperSafePassword!", $hashed_password)
Example 2: php hash password
$pass = password_hash($password, PASSWORD_DEFAULT);
password_verify($password, $hashed_password);
Example 3: password_hash() php 7
<?php
$options = [
'cost' => 11,
'salt' => mcrypt_create_iv(22, MCRYPT_DEV_URANDOM),
];
echo password_hash("rasmuslerdorf", PASSWORD_BCRYPT, $options)."\n";
?>
Example 4: php hash
$password = 'test123';
$options['salt'] = 'usesomesillystringforsalt';
$options['cost'] = 3;
echo password_hash($password, PASSWORD_BCRYPT, $options)
Example 5: php hash password
<?php
$options = [
'cost' => 12,
];
echo password_hash("rasmuslerdorf", PASSWORD_BCRYPT, $options);
?>
Example 6: php hash
<?php
echo hash('ripemd160', 'The quick brown fox jumped over the lazy dog.');
?>