-
Notifications
You must be signed in to change notification settings - Fork 3
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
Request feature: Exemple Usage + possible bug: strings above 55 bytes not handle properly #3
Comments
Did you solve that problem ? I have same problem in the latest version including your fix. |
What input did you try to serialize ? What result do you expect from it ? |
Same input like you. below:
But it prints out |
My code is here.
|
I think the data is placed in "serialized_lorem" correctly. |
Recommend using
|
Pretty late to the party, this got me also. It isn't a bug in the serialized_lorem. Instead its an issue with how you print to hex. In the code the length is prepended to the data using this:
which represents the length as a single char, if the offset (0xC0 for example) pushes this above what can be represented as a single signed byte then it will be represented as a negative in std::string. When printing if this gets interpreted as a signed char and converted to an unsigned char, then your output will be incorrect. Hence why HexStr is recommended going to hexidecimal |
I'm playing around your rlpvalue package in order to serialize an ethereum transaction.
It prints
\xffffffb8 \x4c \x6f ...
but should print\xb8 \x38 \x4c ...
instead, it looks like rlpvalue does not handle properly strings with length above 55 bytes, see medium post (Ctrl+F and "Rule 2")NB: On my mac, I also had to install
brew install argp-standalone
before doing the installation to compile properlyThe text was updated successfully, but these errors were encountered: