如何在PHP中使用bcrypt或scrypt? 是否有一个使用这两个中的任何一个的默认内置函数? [重复]

This question already has an answer here:

Is there a default built in function in PHP that allows for use of scrypt or bcrypt?

</div>

For PHP 5.5.0 or above:

Read the relevant FAQ on PHP.net. More notably, you should check out this page on password hashing. Example:

echo password_hash("rasmuslerdorf", PASSWORD_BCRYPT, array('cost' => 12));

For earlier versions, look at the password_compat library by ircmaxwell.

PHP Crypt function uses bcrypt.

If you're using PHP 5.5.0 or greater then you can use Password Hash with crypt.