1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 23:48:12 +00:00

replace removed iterbytes with direct iteration

This commit is contained in:
matejcik 2018-02-28 17:00:16 +01:00 committed by matejcik
parent 5422c40451
commit 2c15a861dc

View File

@ -62,7 +62,7 @@ def b58encode(v):
""" encode v, which is a string of bytes, to base58.""" """ encode v, which is a string of bytes, to base58."""
long_value = 0 long_value = 0
for c in iterbytes(v): for c in v:
long_value = long_value * 256 + c long_value = long_value * 256 + c
result = '' result = ''
@ -75,7 +75,7 @@ def b58encode(v):
# Bitcoin does a little leading-zero-compression: # Bitcoin does a little leading-zero-compression:
# leading 0-bytes in the input become leading-1s # leading 0-bytes in the input become leading-1s
nPad = 0 nPad = 0
for c in iterbytes(v): for c in v:
if c == 0: if c == 0:
nPad += 1 nPad += 1
else: else: