public static function Crypt::randomStringHashed

Generates a random, base-64 encoded, URL-safe, sha-256 hashed string.

Parameters

int $count: The number of characters (bytes) of the string to be hashed.

Return value

string A base-64 encoded sha-256 hash, with + replaced with -, / with _ and any = padding characters removed.

See also

\Drupal\Component\Utility\Crypt::randomBytes()

\Drupal\Component\Utility\Crypt::hashBase64()

5 calls to Crypt::randomStringHashed()
drupal_get_private_key in drupal/core/includes/common.inc
Ensures the private key variable used to generate tokens is set.
drupal_install_config_directories in drupal/core/includes/install.inc
Creates the config directory and ensures it is operational.
install_settings_form_submit in drupal/core/includes/install.core.inc
Form submission handler for install_settings_form().
system_install in drupal/core/modules/system/system.install
Implements hook_install().
user_pass_reset in drupal/core/modules/user/user.pages.inc
Menu callback; process one time login link and redirects to the user page on success.

File

drupal/core/lib/Drupal/Component/Utility/Crypt.php, line 121
Contains \Drupal\Component\Utility\Crypt.

Class

Crypt
Utility class for cryptographically-secure string handling routines.

Namespace

Drupal\Component\Utility

Code

public static function randomStringHashed($count) {
  return static::hashBase64(static::randomBytes($count));
}