ethereumjs-util v7.1.4
holgerd77
released this
01 Feb 09:05
·
1570 commits
to master
since this release
Buffer <-> Uint8Array Conversion Helpers (RLP v3)
The new RLP v3 release is accepting and returning Uint8Array
objects instead of Buffer
for improved browser compatibility and usage.
There are two new helper functions in the bytes
module from the Util
library introduced in PR #1648 to help with associated Buffer conversions (while this is our main reason for introducing these functions the functionality can of course be used for other things as well):
arrToBufArr()
: Converts aUint8Array
orNestedUint8Array
toBuffer
orNestedBufferArray
bufArrToArr()
: Converts aBuffer
orNestedBufferArray
toUint8Array
orNestedUint8Array
Note: the RLP version exposed by this package as a re-export is still RLP v2
. This won't change along additional v7
Util releases and other current monorepo libraries (VM, Tx,...) are also still using the v2
RLP version.
Features
- New
validateNoLeadingZeroes()
function inbytes
module for validating Buffers to have no leading zeros (mainly within an RLP context), PR #1568 - New
MAX_UINT64
constant which can be used to check if aBN
instance exceeds the max. possible 64-bit integer value, PR #1568