diff --git a/README_js.md b/README_js.md index 19f70ffe..1c311fea 100644 --- a/README_js.md +++ b/README_js.md @@ -1,5 +1,5 @@ ```javascript --hide -import crypto from 'crypto'; +import crypto from 'node:crypto'; runmd.onRequire = (path) => { if (path == 'rng') return fun; diff --git a/src/md5.ts b/src/md5.ts index 2621291b..e240e6de 100644 --- a/src/md5.ts +++ b/src/md5.ts @@ -1,4 +1,4 @@ -import { createHash } from 'crypto'; +import { createHash } from 'node:crypto'; function md5(bytes: Uint8Array) { if (Array.isArray(bytes)) { diff --git a/src/native.ts b/src/native.ts index 9c3ca1f2..053b54ef 100644 --- a/src/native.ts +++ b/src/native.ts @@ -1,3 +1,3 @@ -import { randomUUID } from 'crypto'; +import { randomUUID } from 'node:crypto'; export default { randomUUID }; diff --git a/src/rng.ts b/src/rng.ts index c8c6362b..ae361bf3 100644 --- a/src/rng.ts +++ b/src/rng.ts @@ -1,4 +1,4 @@ -import { randomFillSync } from 'crypto'; +import { randomFillSync } from 'node:crypto'; const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate let poolPtr = rnds8Pool.length; diff --git a/src/sha1.ts b/src/sha1.ts index 1030e6a9..2d4ae0ab 100644 --- a/src/sha1.ts +++ b/src/sha1.ts @@ -1,4 +1,4 @@ -import { createHash } from 'crypto'; +import { createHash } from 'node:crypto'; function sha1(bytes: Uint8Array) { if (Array.isArray(bytes)) {