Introduce @polkadot/util-rlp (#76)
* Add toU8a conversions * Add u8a utilities * @polkadot/rlp with encoding * Decoding test runthrough * Update util locations * Convert util-triehash to use util-rlp * Allow keccak from Uint8Array * Pass Uint8Array to keccak input * Update documentation * Skip some doc generation * Update @polkadot/dev * Update doc typo * Update allocations * Retrieve tests from ethereumjs-testing * Simplify test retrieval * Exclude etereumjs-testing from flow
This commit is contained in:
@@ -19,11 +19,5 @@ module.exports = function bufferToU8a (buffer?: Buffer): Uint8Array {
|
||||
return new Uint8Array([]);
|
||||
}
|
||||
|
||||
const array = new Uint8Array(buffer.length);
|
||||
|
||||
for (let index = 0; index < buffer.length; ++index) {
|
||||
array[index] = buffer[index];
|
||||
}
|
||||
|
||||
return array;
|
||||
return new Uint8Array(buffer);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user