From 19aaeb374b0ea205189de245c36d6960e329d019 Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Sat, 4 Apr 2026 13:46:08 +0200 Subject: [PATCH] Remove sample based image hashing to avoid false equalities (#3980) * Remove sample based image hashing to avoid false equalities This was originally introduced to improve the performance of working with image data, but since the memo hash wrapper got introduced this should no longer be really necessary. * Fix todo comment --- node-graph/libraries/raster-types/src/image.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/node-graph/libraries/raster-types/src/image.rs b/node-graph/libraries/raster-types/src/image.rs index 83de9edb..420b2439 100644 --- a/node-graph/libraries/raster-types/src/image.rs +++ b/node-graph/libraries/raster-types/src/image.rs @@ -109,17 +109,11 @@ impl BitmapMut for Image

{ } } -// TODO: Evaluate if this will be a problem for our use case. -/// Warning: This is an approximation of a hash, and is not guaranteed to not collide. impl Hash for Image

{ fn hash(&self, state: &mut H) { - const HASH_SAMPLES: u64 = 1000; - let data_length = self.data.len() as u64; self.width.hash(state); self.height.hash(state); - for i in 0..HASH_SAMPLES.min(data_length) { - self.data[(i * data_length / HASH_SAMPLES) as usize].hash(state); - } + self.data.hash(state); } }