function PhpassHashedPasswordBase::hash

Same name in other branches
  1. 11.x core/lib/Drupal/Core/Password/PhpassHashedPasswordBase.php \Drupal\Core\Password\PhpassHashedPasswordBase::hash()

File

core/lib/Drupal/Core/Password/PhpassHashedPasswordBase.php, line 250

Class

PhpassHashedPasswordBase
Legacy password hashing framework.

Namespace

Drupal\Core\Password

Code

public function hash($password) {
    if (isset($this->corePassword)) {
        return $this->corePassword
            ->hash($password);
    }
    // @phpstan-ignore-next-line
    return $this->crypt('sha512', $password, $this->generateSalt());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.