function public static function Crypt::generateBase64HashIdentifier

8.x-3.x Crypt.php public static Crypt::generateBase64HashIdentifier(array $data, $prefix = NULL, $delimiter = ':')

Generates a unique identifier by serializing and hashing an array of data.

Parameters

array $data: The data to serialize and hash.

string|string[] $prefix: The value(s) to use to prefix the identifier, separated by colons (:).

string $delimiter: The delimiter to use when joining the prefix and hash.

Return value

string The uniquely generated identifier.

Class

Crypt
Extends \Drupal\Component\Utility\Crypt.

Namespace

Drupal\bootstrap\Utility

Source src/Utility/Crypt.php (line 131)

public static function generateBase64HashIdentifier(array $data, $prefix = NULL, $delimiter = ':') {
  $prefix = Unicode::castToString($prefix, $delimiter);
  $hash = self::hashBase64(serialize(array_merge([$prefix], $data)));
  return $prefix ? $prefix . $delimiter . $hash : $hash;
}