Fix ranging in Base58Encode and Base58Decode
This commit is contained in:
parent
58f9eb7dc5
commit
cb32e7ca13
|
@ -23,7 +23,7 @@ func Base58Encode(input []byte) []byte {
|
||||||
}
|
}
|
||||||
|
|
||||||
ReverseBytes(result)
|
ReverseBytes(result)
|
||||||
for b := range input {
|
for _, b := range input {
|
||||||
if b == 0x00 {
|
if b == 0x00 {
|
||||||
result = append([]byte{b58Alphabet[0]}, result...)
|
result = append([]byte{b58Alphabet[0]}, result...)
|
||||||
} else {
|
} else {
|
||||||
|
@ -39,7 +39,7 @@ func Base58Decode(input []byte) []byte {
|
||||||
result := big.NewInt(0)
|
result := big.NewInt(0)
|
||||||
zeroBytes := 0
|
zeroBytes := 0
|
||||||
|
|
||||||
for b := range input {
|
for _, b := range input {
|
||||||
if b == 0x00 {
|
if b == 0x00 {
|
||||||
zeroBytes++
|
zeroBytes++
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue