function CacheCollector::fingerprint

Same name and namespace in other branches
  1. main core/lib/Drupal/Core/Cache/CacheCollector.php \Drupal\Core\Cache\CacheCollector::fingerprint()

Computes a fingerprint of cache item data for change detection.

Parameters

array $data: The cache item data.

Return value

string A hash of the data. A concurrent write that changes the data produces a different fingerprint, even when it happens within the same millisecond.

1 call to CacheCollector::fingerprint()
CacheCollector::updateCache in core/lib/Drupal/Core/Cache/CacheCollector.php
Writes a value to the persistent cache immediately.

File

core/lib/Drupal/Core/Cache/CacheCollector.php, line 305

Class

CacheCollector
Default implementation for CacheCollectorInterface.

Namespace

Drupal\Core\Cache

Code

protected function fingerprint(array $data) : string {
  return hash('xxh128', serialize($data));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.