* Dependency version checks * Add depndecy detection for all * Cleanup util detectPackage * Single detectPackage * Update packages/hw-ledger/src/detectPackage.ts * Update packages/util/src/detectPackage.ts * non-indexed imports
15 lines
382 B
TypeScript
15 lines
382 B
TypeScript
// Copyright 2017-2021 @polkadot/x-randomvalues authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import crypto from 'crypto';
|
|
|
|
export { packageInfo } from './packageInfo';
|
|
|
|
export function getRandomValues <T extends Uint8Array> (arr: T): T {
|
|
return crypto.randomBytes(arr.length).reduce((arr, value, index) => {
|
|
arr[index] = value;
|
|
|
|
return arr;
|
|
}, arr);
|
|
}
|