diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2021-07-29 10:42:44 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2021-07-29 10:43:30 +0200 |
commit | ae1a190f4358b36af673e1fd3a81f1b6e630dd5a (patch) | |
tree | 6ae21e2ee778aa92c335c734891b4430304d4021 | |
parent | 08d625619c6ec28b00087dfead87abc124a2fb9b (diff) | |
download | cpaste-ae1a190f4358b36af673e1fd3a81f1b6e630dd5a.tar.gz cpaste-ae1a190f4358b36af673e1fd3a81f1b6e630dd5a.tar.xz cpaste-ae1a190f4358b36af673e1fd3a81f1b6e630dd5a.zip |
base58_encode: Rename l to x
-rwxr-xr-x | cpaste | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -56,15 +56,15 @@ def base58_encode(v: bytes): v = v.lstrip(b'\0') nPad -= len(v) - l = 0 + x = 0 for (i, c) in enumerate(v[::-1]): if isinstance(c, str): c = ord(c) - l += c << (8 * i) + x += c << (8 * i) string = b'' - while l: - l, idx = divmod(l, alphabet_len) + while x: + x, idx = divmod(x, alphabet_len) string = alphabet[idx:idx+1] + string return (alphabet[0:1] * nPad + string) |