Skip to content
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

eth/util: fix single-byte hex-string nibbles #298

Merged
merged 1 commit into from
Dec 17, 2024
Merged

eth/util: fix single-byte hex-string nibbles #298

merged 1 commit into from
Dec 17, 2024

Conversation

q9f
Copy link
Owner

@q9f q9f commented Dec 17, 2024

fix single-byte hex-string nibbles:

[1] pry(main)> Util.hex_to_bin "a"
=> "\n"
[2] pry(main)> Util.bin_to_hex "\n"
=> "0a"
[3] pry(main)> Util.bin_to_hex Util.hex_to_bin "a"
=> "0a"

this fixes the bug raised in #292

[1] pry(main)> Rlp.encode "a"
=> "a"
[2] pry(main)> Rlp.decode "a"
=> "\n"
[3] pry(main)> Rlp.decode Rlp.encode "a"
=> "\n"
[4] pry(main)> Util.bin_to_hex Rlp.decode Rlp.encode "a"
=> "0a"

@q9f q9f merged commit d6e5177 into main Dec 17, 2024
8 checks passed
@q9f q9f deleted the q9f/util/hex branch December 17, 2024 13:18
@q9f q9f added the bug Something isn't working label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant