Create createKeyMulti & createKeySub for utility (util-crypto) (#587)

* Create keyMulti & keysub for utility

* Bumps
This commit is contained in:
Jaco Greeff
2020-04-24 15:34:47 +02:00
committed by GitHub
parent b196158125
commit 60a9866abe
9 changed files with 716 additions and 529 deletions
+2 -3
View File
@@ -22,9 +22,8 @@ import u8aToU8a from './toU8a';
* ```
*/
export default function u8aConcat (..._list: (Uint8Array | string)[]): Uint8Array {
const list: Uint8Array[] = _list.map(u8aToU8a);
const length = list.reduce((total, item): number => total + item.length, 0);
const result = new Uint8Array(length);
const list = _list.map(u8aToU8a);
const result = new Uint8Array(list.reduce((total, item): number => total + item.length, 0));
let offset = 0;
return list.reduce((result, item): Uint8Array => {