From f906d13e9082709f50512b255583782349a01fd1 Mon Sep 17 00:00:00 2001 From: Ivan Smirnov Date: Wed, 29 Dec 2021 16:11:27 +0300 Subject: [PATCH] Update pixel hash function to the latest spec --- src/pixel.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pixel.rs b/src/pixel.rs index d2f89e5..e353e16 100644 --- a/src/pixel.rs +++ b/src/pixel.rs @@ -42,7 +42,7 @@ impl Pixel { #[inline] pub const fn hash_index(self) -> u8 { - (self.r() ^ self.g() ^ self.b() ^ self.a_or(0xff)) % 64 + (self.r() * 3 + self.g() * 5 + self.b() * 7 + self.a_or(0xff) * 11) % 64 } #[inline]