Skip to content

Latest commit

 

History

History
22 lines (15 loc) · 490 Bytes

PasswordHash.md

File metadata and controls

22 lines (15 loc) · 490 Bytes

PasswordHash

The password_hash() function added in PHP 5.5 is a wrapper for the crypt() function. Also, since it is compatible with existing password hashes, you should use this.

Before

<?php
$password = crypt('secret text', generate_salt()); // PasswordHash: Use of `password_hash()` is encouraged.

After

<?php
$password = password_hash('secret text', PASSWORD_DEFAULT); // OK!

Reference

https://secure.php.net/manual/function.password-hash.php