We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7eeaf67 commit 12152adCopy full SHA for 12152ad
lib/random.function.ts
@@ -1,10 +1,10 @@
1
-import * as crypto from "crypto";
+import {randomBytes} from "crypto";
2
3
export const generateRandom = (params: { byteLength: number } = {
4
byteLength: 16,
5
}): Promise<Buffer> => {
6
return new Promise((resolve, reject) => {
7
- crypto.randomBytes(params.byteLength, (err, buffer) => {
+ randomBytes(params.byteLength, (err, buffer) => {
8
if (err) {
9
reject(err);
10
} else {
0 commit comments