user_hash_password
function user_hash_password
user_hash_password($password, $count_log2 = 0)
Hash a password using a secure hash.
Parameters
$password: A plain-text password.
$count_log2: Optional integer to specify the iteration count. Generally used only during mass operations where a value less than the default is needed for speed.
Return value
A string containing the hashed password (and a salt), or FALSE on failure.
File
- includes/password.inc, line 211
- Secure password hashing functions for user authentication.
Code
function user_hash_password($password, $count_log2 = 0) { if (empty($count_log2)) { // Use the standard iteration count. $count_log2 = variable_get('password_count_log2', DRUPAL_HASH_COUNT); } return _password_crypt('sha512', $password, _password_generate_salt($count_log2)); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!password.inc/function/user_hash_password/7.x