@polkadot/primitives-rlp
v0.17.9
Published
Conversion utilities to format primitives for RLP representation
Downloads
27
Readme
@polkadot/primitives-rlp
Conversion of Polkadot types to and from Uint8Array
, ready for rlp conversion. It converts from complex classes to the correct rlp representation.
Usage
Installation -
npm install --save @polkadot/primitives-rlp
Usage -
const { parachainIdDecode, parachainIdEncode } = require('@polkadot/primitives-rlp');
parachainIdDecode( // step 3 - BN `0x123456`
parachainIdEncode( // step 1 - Uint8Array `[0x12, 0x34, 0x56]`
new BN('0x123456') // step 0 - BN `0x123456`
)
);