git://git.novaco.in
/
p2pool.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
fixed natural_to_string's encoding of 0
[p2pool.git]
/
p2pool
/
util
/
math.py
diff --git
a/p2pool/util/math.py
b/p2pool/util/math.py
index
c13494f
..
c45d1ec
100644
(file)
--- a/
p2pool/util/math.py
+++ b/
p2pool/util/math.py
@@
-179,7
+179,7
@@
def natural_to_string(n, alphabet=None):
if n < 0:
raise TypeError('n must be a natural')
if alphabet is None:
- s = '%x' % (n,)
+ s = ('%x' % (n,)).lstrip('0')
if len(s) % 2:
s = '0' + s
return s.decode('hex')