function drupal_hash_base64

7.x bootstrap.inc drupal_hash_base64($data)

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.

25 calls to drupal_hash_base64()
ActionLoopTestCase::testActionLoop in drupal-7.x/modules/simpletest/tests/actions.test
Set up a loop with 3 - 12 recursions, and see if it aborts properly.
ActionsConfigurationTestCase::testActionConfiguration in drupal-7.x/modules/simpletest/tests/actions.test
Test the configuration of advanced actions through the administration interface.
actions_actions_map in drupal-7.x/includes/actions.inc
Creates an associative array keyed by hashes of function names or IDs.
actions_function_lookup in drupal-7.x/includes/actions.inc
Returns an action array key (function or ID), given its hash.
aggregator_test_feed in drupal-7.x/modules/aggregator/tests/aggregator_test.module
Page callback. Generates a test feed and simulates last-modified and etags.

... See full list

File

drupal-7.x/includes/bootstrap.inc, line 2067
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('+' => '-', '/' => '_', '=' => ''));
}