ethers.js/packages/random/src.ts/random.ts

8 lines
208 B
TypeScript
Raw Permalink Normal View History

2020-11-14 17:42:36 -05:00
import { randomBytes as _randomBytes } from "crypto";
import { arrayify } from "@ethersproject/bytes";
export function randomBytes(length: number): Uint8Array {
return arrayify(_randomBytes(length));
}