From: Zooko O'Whielacronx Date: Thu, 3 Jan 2008 18:43:11 +0000 (-0700) Subject: fix idlib.could_be_base32_encoded_l() to accept *only* valid strings X-Git-Tag: allmydata-tahoe-0.7.0~46 X-Git-Url: https://git.rkrishnan.org/specifications/index.php?a=commitdiff_plain;h=c0669035666af94a7faae568224f7fb297f0ca31;p=tahoe-lafs%2Ftahoe-lafs.git fix idlib.could_be_base32_encoded_l() to accept *only* valid strings --- 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()