function advagg_sri_compute_hashes in Advanced CSS/JS Aggregation 7.2
Returns an array of hashes.
Parameters
string $contents: The string to hash.
Return value
array The hashes for the given string.
2 calls to advagg_sri_compute_hashes()
- advagg_sri_advagg_save_aggregate_alter in advagg_sri/
advagg_sri.advagg.inc - Implements hook_advagg_save_aggregate_alter().
- advagg_sri_get_filenames_hashes in advagg_sri/
advagg_sri.advagg.inc - Returns the hashes settings.
File
- advagg_sri/
advagg_sri.advagg.inc, line 232 - Advanced aggregation sri module.
Code
function advagg_sri_compute_hashes($contents) {
// Generate hashes.
$hashes = array(
'sha512' => base64_encode(hash('sha512', $contents, TRUE)),
'sha384' => base64_encode(hash('sha384', $contents, TRUE)),
'sha256' => base64_encode(hash('sha256', $contents, TRUE)),
);
return $hashes;
}