Reputation: 13172
My code is like this :
<?php
$password = '12345';
echo bcrypt($password);
?>
It's not working
Its error is Fatal error: Call to undefined function bcrypt() in...
Whether to load library?
Thank you
Upvotes: 1
Views: 3974
Reputation: 121
Try to do it this way
echo password_hash('123456', PASSWORD_BCRYPT);
Upvotes: 0
Reputation: 4236
As noted in this answer, you can use the following:
<?php
$password = '12345';
echo password_hash($password, PASSWORD_DEFAULT)."\n";
?>
Upvotes: 2