You are here

function facetapi_hash_delta in Facet API 6.3

Same name and namespace in other branches
  1. 7.2 facetapi.block.inc \facetapi_hash_delta()
  2. 7 facetapi.block.inc \facetapi_hash_delta()

Hashing code for deltas.

Parameters

$delta: A string containing the delta.

Return value

The hashed delta value.

2 calls to facetapi_hash_delta()
FacetapiTestCase::enableFacet in tests/facetapi.test
Enables a facet in the block realm, adds it to the "sidebar_first" region.
FacetapiWidget::init in plugins/facetapi/widget.inc
Initializes the build, must be invoked prior to executing this widget.

File

./facetapi.block.inc, line 247
Block realm code and hook implementations.

Code

function facetapi_hash_delta($delta) {

  // Ensure hashes are URL safe and alpha-numeric.
  // @see http://drupal.org/node/1355270
  $hash = substr(facetapi_hash_base64($delta), 0, 32);
  return strtr($hash, array(
    '-' => '0',
    '_' => '1',
  ));
}