2
0
mirror of synced 2025-02-25 04:25:16 +00:00
ethers.js/src.ts/utils/random-bytes.ts

13 lines
265 B
TypeScript
Raw Normal View History

2018-06-13 15:39:39 -04:00
'use strict';
import { arrayify } from './convert';
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
//function _randomBytes(length) { return "0x00"; }
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