Skip to content

Commit 8ba2b05

Browse files
committed
utils: remove crypto
1 parent d578e05 commit 8ba2b05

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

Diff for: src/utils.ts

-16
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,3 @@ export function wrapHash(hash: (msg: Uint8Array) => Uint8Array) {
5151
return hash(msg);
5252
};
5353
}
54-
55-
declare const globalThis: Record<string, any> | undefined;
56-
57-
// TODO(v3): switch away from node crypto, remove this unnecessary variable.
58-
export const crypto: { node?: any; web?: any } = (() => {
59-
const webCrypto =
60-
typeof globalThis === "object" && "crypto" in globalThis ? globalThis.crypto : undefined;
61-
const nodeRequire =
62-
typeof module !== "undefined" &&
63-
typeof module.require === "function" &&
64-
module.require.bind(module);
65-
return {
66-
node: nodeRequire && !webCrypto ? nodeRequire("crypto") : undefined,
67-
web: webCrypto
68-
};
69-
})();

0 commit comments

Comments
 (0)