-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doesn't encode empty bytes properly? #1
Comments
Hi. Thanks for the report. Fixing the encoding of empty buffer should be pretty easy I think. I'll see if I can add some fuzzing tests for validating the round-trip. |
should be fixed now. would you mind giving |
Works for me. I threw in another (few hundred) round trip tests in a loop just in case: #3 |
The freshly cut 0.2.2 release has this fix now :) |
Awesome, thanks. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think the empty byte string
b''
should encode to the empty string""
. Instead, it currently encodes to"11"
.Similarly, the string
"1"
should decode to the byteb'\x00'
. Instead, it currently decodes tob'\x00\x00'
.I'm not totally sure about the right behavior for Base58 padding, but I think at least it should be possible to round-trip any string of bytes. Right now if you send any number of zero-bytes (including the empty bytestring) through encode+decode, you get a different number of bytes back out.
The text was updated successfully, but these errors were encountered: