<?php
/**
* Note that the salt here is randomly generated.
* Never use a static salt or one that is not randomly generated.
*
* For the VAST majority of use-cases, let password_hash generate the salt randomly for you
*/
$options = [
'cost' => 11,
'salt' => mcrypt_create_iv(256, MCRYPT_DEV_URANDOM),
];
echo password_hash("rasmuslerdorf", PASSWORD_BCRYPT, $options)."\n";
?>
Fatal error: Uncaught Error: Call to undefined function mcrypt_create_iv() in /in/fiMOI:10
Stack trace:
#0 {main}
thrown in /in/fiMOI on line 10
Process exited with code 255.
Output for 7.0.5
Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/fiMOI on line 12
$2y$11$wLTl0CMZuY6vBfLJax6GBe7VYPWdatkkL5RLsECA0DouNIaMWqj5O
Output for 7.0.4
Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/fiMOI on line 12
$2y$11$JZwRW00hRoeoinO1jxV7ZuB/K5GjFHbEiw8Op1.o0tZNpBBkEVwei
Output for 7.0.3
Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/fiMOI on line 12
$2y$11$qDNiE0B9ldS5.5.1g70nneg4k2nEbk.NSYzyGxBx6nDu0UydLrKT2
Output for 7.0.2
Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/fiMOI on line 12
$2y$11$CoSHbmmjuR/mWEi732kOw.WQQO.iKEehJZqCA5T66g/63XNCnR/Eq
Output for 7.0.1
Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/fiMOI on line 12
$2y$11$AetoXuCMJ86JRYc2ofPDf.l2CQM9EtHU57fy34V/I/F2CP5haSrZO
Output for 7.0.0
Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/fiMOI on line 12
$2y$11$tUx0s2hy5lQbSUvVDdbY2uPu3IBcOFcIfom3rl5APjobsIw6Ketcy
Output for 5.5.35, 5.6.21 - 5.6.28
Fatal error: Call to undefined function mcrypt_create_iv() in /in/fiMOI on line 10
Process exited with code 255.