function facetapi_hash_delta in Facet API 7.2
Same name and namespace in other branches
- 6.3 facetapi.block.inc \facetapi_hash_delta()
- 7 facetapi.block.inc \facetapi_hash_delta()
Hashing code for deltas.
Parameters
$delta: A string containing the delta.
Return value
The hashed delta value.
1 call to facetapi_hash_delta()
- FacetapiTestCase::facetapiEnableFacetBlock in tests/
facetapi.test - Enables a facet block via the UI.
File
- ./
facetapi.block.inc, line 276 - 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(drupal_hash_base64($delta), 0, 32);
$hash = strtr($hash, array(
'-' => '0',
'_' => '1',
));
drupal_alter('facetapi_hash', $hash, $delta);
return $hash;
}