From 3fd0f1835f6705df7e9ab99b46e4add05f5d8138 Mon Sep 17 00:00:00 2001 From: Jay Bell Date: Mon, 3 Jun 2024 07:11:53 -0700 Subject: [PATCH] build: use node:crypto not crypto when importing (#736) --- src/md5.js | 2 +- src/native.js | 2 +- src/rng.js | 2 +- src/sha1.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/md5.js b/src/md5.js index cf692f4e..7e56496e 100644 --- a/src/md5.js +++ b/src/md5.js @@ -1,4 +1,4 @@ -import crypto from 'crypto'; +import crypto from 'node:crypto'; function md5(bytes) { if (Array.isArray(bytes)) { diff --git a/src/native.js b/src/native.js index 14f8b8f3..fb372ebc 100644 --- a/src/native.js +++ b/src/native.js @@ -1,3 +1,3 @@ -import crypto from 'crypto'; +import crypto from 'node:crypto'; export default { randomUUID: crypto.randomUUID }; diff --git a/src/rng.js b/src/rng.js index cdd4cfa7..ce2c7160 100644 --- a/src/rng.js +++ b/src/rng.js @@ -1,4 +1,4 @@ -import crypto from 'crypto'; +import crypto from 'node:crypto'; const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate let poolPtr = rnds8Pool.length; diff --git a/src/sha1.js b/src/sha1.js index bb46cbea..c5773362 100644 --- a/src/sha1.js +++ b/src/sha1.js @@ -1,4 +1,4 @@ -import crypto from 'crypto'; +import crypto from 'node:crypto'; function sha1(bytes) { if (Array.isArray(bytes)) {