From 6091170ed4e3cde3b2c983b2e4688106d289a1b3 Mon Sep 17 00:00:00 2001 From: Alek Ratzloff Date: Mon, 3 Jun 2024 10:08:36 -0700 Subject: [PATCH] Fix fatal bug in RandomartMatricizer Big oops on my part. The Randomart was looking a bit "same-y", and for a good reason. The algorithm should be going in two-bit chunks at a time, but I completely forgot to shift the bits over every time. This is added now, huge mistake on my part whoopsie Signed-off-by: Alek Ratzloff --- colorhash/matricizer.py | 1 + examples/commithash.svg | 80 ++++++++++++++++++++--------------------- 2 files changed, 41 insertions(+), 40 deletions(-) diff --git a/colorhash/matricizer.py b/colorhash/matricizer.py index 6b8f17c..bc523d2 100644 --- a/colorhash/matricizer.py +++ b/colorhash/matricizer.py @@ -169,6 +169,7 @@ class RandomartMatricizer(Matricizer): # max value is 0xf if rows[r][c] < 0xF: rows[r][c] += 1 + value >>= 2; return rows @staticmethod diff --git a/examples/commithash.svg b/examples/commithash.svg index 65bc5d4..d5150f5 100644 --- a/examples/commithash.svg +++ b/examples/commithash.svg @@ -1,42 +1,42 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file