Fix base58 encode on threshold
This commit is contained in:
parent
99e30759b4
commit
734b3d1baa
|
@ -55,7 +55,7 @@ func EncodeMoneroBase58(data ...[]byte) (result string) {
|
|||
}
|
||||
length := len(combined)
|
||||
rounds := length / 8
|
||||
for i := 0; i < rounds; i++ {
|
||||
for i := 0; i <= rounds; i++ {
|
||||
result += encodeChunk(combined[i*8:(i+1)*8], 11)
|
||||
}
|
||||
if length%8 > 0 {
|
||||
|
@ -67,7 +67,7 @@ func EncodeMoneroBase58(data ...[]byte) (result string) {
|
|||
func DecodeMoneroBase58(data string) (result []byte) {
|
||||
length := len(data)
|
||||
rounds := length / 11
|
||||
for i := 0; i < rounds; i++ {
|
||||
for i := 0; i <= rounds; i++ {
|
||||
result = append(result, decodeChunk(data[i*11:(i+1)*11])...)
|
||||
}
|
||||
if length%11 > 0 {
|
||||
|
|
Reference in a new issue