Commit 3f1ba54d authored by alexpott's avatar alexpott

Issue #2546680 by catch: Use hash('crc32b') not crc32()

parent 4710b097
......@@ -73,7 +73,7 @@ public function onConfigSave(ConfigCrudEvent $event) {
$name = $saved_config->getName();
$data = $saved_config->get();
$checksum = crc32(serialize($data));
$checksum = hash('crc32b', serialize($data));
$exceptions = array(
// Following are used to test lack of or partial schema. Where partial
// schema is provided, that is explicitly tested in specific tests.
......
......@@ -465,7 +465,7 @@ protected function getSingleFieldDisplay($entity, $field_name, $display_options)
// series of fields individually for cases such as views tables.
$entity_type_id = $entity->getEntityTypeId();
$bundle = $entity->bundle();
$key = $entity_type_id . ':' . $bundle . ':' . $field_name . ':' . crc32(serialize($display_options));
$key = $entity_type_id . ':' . $bundle . ':' . $field_name . ':' . hash('crc32b', serialize($display_options));
if (!isset($this->singleFieldDisplays[$key])) {
$this->singleFieldDisplays[$key] = EntityViewDisplay::create(array(
'targetEntityType' => $entity_type_id,
......
......@@ -277,7 +277,7 @@ public function getPropertyInstance(TypedDataInterface $object, $property_name,
if ($settings = $root_definition->getSettings()) {
// Hash the settings into a string. crc32 is the fastest way to hash
// something for non-cryptographic purposes.
$parts[] = crc32(serialize($settings));
$parts[] = hash('crc32b', serialize($settings));
}
// Property path for the requested data object. When creating a list item,
// use 0 in the key as all items look the same.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment