ethers.js/src.ts/utils/random-bytes.ts

11 lines
211 B
TypeScript
Raw Permalink Normal View History

2018-06-13 15:39:39 -04:00
'use strict';
2018-06-17 16:47:28 -04:00
import { arrayify } from './bytes';
2018-06-13 15:39:39 -04:00
2018-06-15 04:18:17 -04:00
import { randomBytes as _randomBytes } from 'crypto';
2018-06-13 15:39:39 -04:00
2018-06-15 04:18:17 -04:00
export function randomBytes(length: number): Uint8Array {
return arrayify(_randomBytes(length));
}
2018-06-13 15:39:39 -04:00