From 1a1cb0d3f1adf8d70ce7ded2b9249f03cfc0e14b Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Wed, 20 Nov 2024 17:55:40 -0800 Subject: [PATCH] fix: Correct percentage calculation in UUID sampling method --- aider/analytics.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aider/analytics.py b/aider/analytics.py index 737cae701..baae92ae4 100644 --- a/aider/analytics.py +++ b/aider/analytics.py @@ -97,8 +97,9 @@ class Analytics: if not uuid_str: return False - # Convert percentage to hex threshold (1% = "03", 10% = "1a", etc) - threshold = format(int(256 * percent / 100), "02x") + # Convert percentage to hex threshold (1% = "04", 10% = "1a", etc) + # Using first 2 hex digits (0-ff) means each digit is 1/256 of the space + threshold = format(int(255 * percent / 100), "02x") return uuid_str < threshold def get_data_file_path(self):