You are here

protected function PermissionsHashGenerator::hash in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Session/PermissionsHashGenerator.php \Drupal\Core\Session\PermissionsHashGenerator::hash()

Hashes the given string.

Parameters

string $identifier: The string to be hashed.

Return value

string The hash.

2 calls to PermissionsHashGenerator::hash()
PermissionsHashGenerator::doGenerate in core/lib/Drupal/Core/Session/PermissionsHashGenerator.php
Generates a hash that uniquely identifies the user's permissions.
PermissionsHashGenerator::generate in core/lib/Drupal/Core/Session/PermissionsHashGenerator.php
Cached by role, invalidated whenever permissions change.

File

core/lib/Drupal/Core/Session/PermissionsHashGenerator.php, line 126
Contains \Drupal\Core\Session\PermissionsHashGenerator.

Class

PermissionsHashGenerator
Generates and caches the permissions hash for a user.

Namespace

Drupal\Core\Session

Code

protected function hash($identifier) {
  return hash('sha256', $this->privateKey
    ->get() . Settings::getHashSalt() . $identifier);
}