public function PhpassHashedPassword::hash

public PhpassHashedPassword::hash($password)

Hash a password using a secure hash.

Parameters

string $password: A plain-text password.

Return value

string A string containing the hashed password, or FALSE on failure.

Overrides PasswordInterface::hash

File

core/lib/Drupal/Core/Password/PhpassHashedPassword.php, line 214

Class

PhpassHashedPassword
Secure password hashing functions based on the Portable PHP password hashing framework.

Namespace

Drupal\Core\Password

Code

public function hash($password) {
  return $this->crypt('sha512', $password, $this->generateSalt());
}

© 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/core!lib!Drupal!Core!Password!PhpassHashedPassword.php/function/PhpassHashedPassword::hash/8.1.x