mhw0 / libethc

Open-source Ethereum C library
https://mhw0.github.io/libethc/
MIT License
46 stars 8 forks source link

rlp: add dynamic integer encoding/decoding functions #11

Closed mhw0 closed 11 months ago

mhw0 commented 11 months ago

It's good to have a function that determines how many bytes it takes to encode the integer instead of manually specifying it. Can be really useful when encoding/decoding non-deterministic recovery id v in the signature.

uint64_t v = 12345;
eth_rlp_uint(&abi, &v); // 12345 occupies 2 bytes (0x3039)

https://github.com/mhw0/libethc/issues/9#issuecomment-1684940837

mhw0 commented 11 months ago

Closing the issue. Added in 8ac8ea1