From c0669035666af94a7faae568224f7fb297f0ca31 Mon Sep 17 00:00:00 2001 From: Zooko O'Whielacronx Date: Thu, 3 Jan 2008 11:43:11 -0700 Subject: [PATCH] fix idlib.could_be_base32_encoded_l() to accept *only* valid strings --- src/allmydata/util/idlib.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/allmydata/util/idlib.py b/src/allmydata/util/idlib.py index a972b22e..8432f580 100644 --- a/src/allmydata/util/idlib.py +++ b/src/allmydata/util/idlib.py @@ -161,9 +161,9 @@ s8 = init_s8() # string tells whether the final character is reasonable. def init_s5(): s5 = [] - add_check_array(chars, s5) - for lenmod5 in (1, 2, 3, 4,): - add_check_array(get_trailing_chars_without_lsbs(4-lenmod5), s5) + add_check_array(get_trailing_chars_without_lsbs(0), s5) + for lenmod5 in [1,2,3,4]: + add_check_array(get_trailing_chars_without_lsbs(5-lenmod5), s5) return tuple(s5) s5 = init_s5() -- 2.45.2