bip32 / bip32.github.io

BIP32 is a Brainwallet-based implementation for BIP0032 deterministic wallet generation
Other
111 stars 71 forks source link

Issue where BigInt.toByteArrayUnsigned returns 31 bytes #4

Open Ninkip2p opened 10 years ago

Ninkip2p commented 10 years ago

Here is an example root key: tprv8ZgxMBicQKsPetSeaqxJJLxz6rRvxz2fuTBKt4ntiqRjTAdmqkqdFKDCX9X9dgPLcEXELNSADqXkDzHs77WJcP6wDvQ5XcX7k5UxBiAZTzH

For some reason BigInt.toByteArrayUnsigned returns byte array without the leading 0 byte, inserting this into the byte array in the case of the length being 31 seems to fix this

anaoum commented 9 years ago

I just submitted a pull request #5 for this bug. Hopefully it gets merged soon as this can go dangerously unnoticed by the end user.

bip32JP commented 9 years ago

Found another place where toByteArrayUnsigned() did some funky stuff...