summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2021-07-29 10:42:44 +0200
committerAndreas Schneider <asn@cryptomilk.org>2021-07-29 10:43:30 +0200
commitae1a190f4358b36af673e1fd3a81f1b6e630dd5a (patch)
tree6ae21e2ee778aa92c335c734891b4430304d4021
parent08d625619c6ec28b00087dfead87abc124a2fb9b (diff)
downloadcpaste-ae1a190f4358b36af673e1fd3a81f1b6e630dd5a.tar.gz
cpaste-ae1a190f4358b36af673e1fd3a81f1b6e630dd5a.tar.xz
cpaste-ae1a190f4358b36af673e1fd3a81f1b6e630dd5a.zip
base58_encode: Rename l to x
-rwxr-xr-xcpaste8
1 files changed, 4 insertions, 4 deletions
diff --git a/cpaste b/cpaste
index 23b9993..5ccaa27 100755
--- a/cpaste
+++ b/cpaste
@@ -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)