Open dmichulke opened 7 years ago
This sounds like a string encoding to byte array issue rather than a bug in the library. If I call getBytes
on the decoded string with the LATIN charset, it yields the same numeric sequence as that returned from bitcoinj:
(map int
(.getBytes
(base58/decode "6sKMMHVLyCQN7Juih2e9tbSmeE5Hu7L8XtBRgowJQvU7")
(java.nio.charset.Charset/forName "ISO-8859-1")))
;=> (87 46 57 118 -100 -90 -41 62 28 104 114 -40 -21 -28 5 58 67 -82 -69 51 113 -86 125 81 93 32 -103 -17 -26 108 -25 0)
I think you might be right though about the ambiguity of not returning it as a byte array
Hi, I have been comparing your lib with that of bitcoinj and it turns out your lib works sometimes correctly but sometimes not. One of the ambiguities is IMO due to decode not returning a byte array, so one has to call getBytes on the resulting string. But there's another problem
Your Code without getBytes
Your Code with getBytes
Bitcoinj:
The differences occur in the 5th character