You are here

public function PhpassHashedPassword::hash in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Password/PhpassHashedPassword.php \Drupal\Core\Password\PhpassHashedPassword::hash()

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