public function PhpassHashedPassword::hash

Implements Drupal\Core\Password\PasswordInterface::hash().

Overrides PasswordInterface::hash

File

drupal/core/lib/Drupal/Core/Password/PhpassHashedPassword.php, line 210
Definition of Drupal\Core\Password\PhpassHashedPassword

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());
}