Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Rlp Laravel Package

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.

View on GitHub
Deep Wiki
Context7
0.4.0

This release fixes several encoding and decoding bugs and makes the decoder strict. It contains breaking changes, see below.

Breaking changes

  • Hex strings are encoded byte for byte, leading zero bytes are no longer removed (#34, fixes #27). Addresses and hashes starting with 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.
  • Negative, fractional and out-of-range numbers throw InvalidArgumentException when encoding (#35). Previously -1 was encoded as 80 and 1.5 as 01. Pass values above PHP_INT_MAX as hex strings.
  • Invalid hex strings throw 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:
    • truncated data and list items longer than their list (#32)
    • data after the top-level item (#32)
    • non-canonical lengths: long form for lengths below 56, or lengths with leading zero bytes (#36)

Fixed

  • Decoding of lists with a payload of 56 bytes or more followed by other items (#30).
  • Encoding of strings containing bytes below 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).
  • Encoding floats in exponent form, e.g. 1e15, crashed with TypeError (#35).
  • Str::encode('', 'ascii') returned 00 instead of an empty string before PHP 8.2.

Changed

  • CI tests PHP 7.1 to 8.4, and uses current versions of actions/cache, actions/checkout and codecov/codecov-action (#30).
  • Documentation of accepted inputs, return values and exceptions.
0.3.5

Change: Fix bug when encode string

0.3.4

Change:

Fix bug when encode integer that is bigger than 160.

0.3.3

Change:

  • Fix bug that return improper length decoding of transaction input data, thanks @Bradez!
  • Remove composer.lock file
0.3.2

Change:

  • Update phpunit
  • Rename src/types to src/Types
  • Update .travis.yml
0.3.1

Fix:

  • Decode single byte returns int instead of hex string.
  • Crash when data is array.
0.3.0

Change:

  • Remove Buffer.
  • Change encode output and decode output.
  • Clean code
0.2.2

Change

  1. Return Buffer([]) when input is 0, negative number, null.
  2. Add tests for issue 14 #14 .
  3. Remove mediumint and bigint test (loss of precision, the problem also in rlp js library).
0.2.1

Fix: Wrong rlp encode when string looks like 0x[Numbers] #11

v0.2

Change:

  • Namespace from RLP to Web3p\RLP
  • More tests
  • README - Write API for rlp

Fix:

0.1.2

Change log:

  • Throw InvalidArgumentException when encoding wasn't supported.
  • Add array access test.
0.1.1

Change log: Fix bug throw exception when value is integer.

0.1

Change: RLP encode and decode.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin