function drupal_hash_base64

Calculates a base-64 encoded, URL-safe sha-256 hash.

Parameters

$data: String to be hashed.

Return value

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

20 calls to drupal_hash_base64()
action_actions_map in drupal/core/modules/action/action.module
Creates an associative array keyed by hashes of function names or IDs.
action_admin_configure in drupal/core/modules/action/action.admin.inc
Form constructor for the configuration of a single action.
action_function_lookup in drupal/core/modules/action/action.module
Returns an action array key (function or ID), given its hash.
aggregator_test_feed in drupal/core/modules/aggregator/tests/aggregator_test.module
Page callback. Generates a test feed and simulates last-modified and etags.
ConfigurationTest::testActionConfiguration in drupal/core/modules/action/lib/Drupal/action/Tests/ConfigurationTest.php
Tests configuration of advanced actions through administration interface.

... See full list

File

drupal/core/includes/bootstrap.inc, line 1998
Functions that need to be loaded on every Drupal request.

Code

function drupal_hash_base64($data) {
  $hash = base64_encode(hash('sha256', $data, TRUE));

  // Modify the hash so it's safe to use in URLs.
  return strtr($hash, array(
    '+' => '-',
    '/' => '_',
    '=' => '',
  ));
}