Fix base58 encode on threshold

This commit is contained in:
DataHoarder 2022-10-07 14:15:30 +02:00
parent 99e30759b4
commit 734b3d1baa
Signed by: DataHoarder
SSH key fingerprint: SHA256:OLTRf6Fl87G52SiR7sWLGNzlJt4WOX+tfI2yxo0z7xk

View file

@ -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 {