mirror of
https://github.com/btcsuite/btcd.git
synced 2024-11-19 01:40:07 +01:00
Merge pull request #1923 from guggero/base58-fix
base58: fix decoding issue
This commit is contained in:
commit
02c854e943
@ -55,6 +55,10 @@ func Decode(b string) []byte {
|
||||
|
||||
total := uint64(0)
|
||||
for _, v := range t[:n] {
|
||||
if v > 255 {
|
||||
return []byte("")
|
||||
}
|
||||
|
||||
tmp := b58[v]
|
||||
if tmp == 255 {
|
||||
return []byte("")
|
||||
|
@ -43,6 +43,8 @@ var invalidStringTests = []struct {
|
||||
{"4kl8", ""},
|
||||
{"0OIl", ""},
|
||||
{"!@#$%^&*()-_=+~`", ""},
|
||||
{"abcd\xd80", ""},
|
||||
{"abcd\U000020BF", ""},
|
||||
}
|
||||
|
||||
var hexTests = []struct {
|
||||
|
Loading…
Reference in New Issue
Block a user