web3p/rlp
web3p/rlp is a PHP library for Recursive Length Prefix (RLP) encoding and decoding, the serialization format used throughout Ethereum. Encode arrays, strings, and integers, or decode 0x-prefixed hex payloads, through a simple API. MIT licensed and installable via Composer.
This release fixes several encoding and decoding bugs and makes the decoder strict. It contains breaking changes, see below.
00 are now
encoded correctly, e.g. 0x0000…0001 (20 bytes) is 94 + 20 bytes instead
of 01. Integer quantities passed as hex must not have leading zeros:
pass 0xcb9d, not 0x00cb9d.InvalidArgumentException when encoding (#35). Previously -1 was
encoded as 80 and 1.5 as 01. Pass values above PHP_INT_MAX as hex
strings.InvalidArgumentException in encode(),
decode(), Str::encode() and Str::decodeHex() (#33). Only a leading
0x is removed and the rest must be hex digits. decode() rejects
odd-length input. This includes strings such as 0xhello, which were
previously encoded as invalid output.decode() throws RuntimeException for invalid RLP:
0x10, e.g. "\x01\x02" is
820102 instead of 12 (#31).decode() crashed with TypeError for long strings declaring a length
above PHP_INT_MAX (#36).1e15, crashed with TypeError
(#35).Str::encode('', 'ascii') returned 00 instead of an empty string before
PHP 8.2.actions/cache,
actions/checkout and codecov/codecov-action (#30).Change: Fix bug when encode string
Change:
Fix bug when encode integer that is bigger than 160.
Change:
Change:
Fix:
Change:
Change
Fix: Wrong rlp encode when string looks like 0x[Numbers] #11
Change:
Fix:
Change log:
Change log: Fix bug throw exception when value is integer.
Change: RLP encode and decode.
How can I help you explore Laravel packages today?