moses toh
moses toh

Reputation: 13172

Bcrypt laravel not working

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

Answers (2)

krrskl
krrskl

Reputation: 121

Try to do it this way

echo password_hash('123456', PASSWORD_BCRYPT);

Upvotes: 0

cstroe
cstroe

Reputation: 4236

As noted in this answer, you can use the following:

<?php
$password = '12345';
echo password_hash($password, PASSWORD_DEFAULT)."\n";
?>

Upvotes: 2

Related Questions