You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/rlp/CHANGELOG.md
+20-1Lines changed: 20 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,26 @@ RLP.encode(1)
27
27
28
28
### Uint8Array
29
29
30
-
Buffers were replaced in favor of using Uint8Arrays for greater compatibility with browsers.
30
+
Buffers were replaced in favor of using Uint8Arrays for improved performance and greater compatibility with browsers.
31
+
32
+
When upgrading from rlp v2 to v3, you must convert your Buffers to Uint8Arrays before passing in. To help, two new utility methods were added to `ethereumjs-util v7.1.4`: `arrToBufArr` and `bufArrToArr`. These will recursively step through your arrays to replace Buffers with Uint8Arrays, or vise versa.
`RLP.decode(encoded, [stream=false])` - Decodes an RLP encoded `Uint8Array`, `Array` or `String` and returns a `Uint8Array` or `NestedUint8Array`. If `stream` is enabled, it will just decode the first rlp sequence in the Uint8Array. By default, it would throw an error if there are more bytes in Uint8Array than used by the rlp sequence.
34
34
35
+
### Buffer compatibility
36
+
37
+
If you would like to continue using Buffers like in rlp v2, you can use:
0 commit comments