Skip to content

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

Merged
q9f merged 1 commit intomainfrom
q9f/util/hex
Dec 17, 2024
Merged

eth/util: fix single-byte hex-string nibbles#298
q9f merged 1 commit intomainfrom
q9f/util/hex

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
@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