From c25f19d66e48435ad6caf9e2f8b59a7c7dd34ff1 Mon Sep 17 00:00:00 2001 From: Christopher Neugebauer Date: Sun, 25 Sep 2016 11:33:07 +1000 Subject: [PATCH] Increases search space for access codes. --- registrasion/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/registrasion/util.py b/registrasion/util.py index 4d09fea4..b5fa0620 100644 --- a/registrasion/util.py +++ b/registrasion/util.py @@ -10,10 +10,10 @@ def generate_access_code(): The access code will 4 characters long, which allows for 1,500,625 unique codes, which really should be enough for anyone. ''' - length = 4 + length = 6 # all upper-case letters + digits 1-9 (no 0 vs O confusion) chars = string.uppercase + string.digits[1:] - # 4 chars => 35 ** 4 = 1500625 (should be enough for anyone) + # 6 chars => 35 ** 6 = 1838265625 (should be enough for anyone) return get_random_string(length=length, allowed_chars=chars)