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

11 lines
211 B
TypeScript
Raw Normal View History

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