Skip to content

Commit

Permalink
utils: remove crypto
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed Sep 11, 2024
1 parent d578e05 commit 8ba2b05
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,3 @@ export function wrapHash(hash: (msg: Uint8Array) => Uint8Array) {
return hash(msg);
};
}

declare const globalThis: Record<string, any> | undefined;

// TODO(v3): switch away from node crypto, remove this unnecessary variable.
export const crypto: { node?: any; web?: any } = (() => {
const webCrypto =
typeof globalThis === "object" && "crypto" in globalThis ? globalThis.crypto : undefined;
const nodeRequire =
typeof module !== "undefined" &&
typeof module.require === "function" &&
module.require.bind(module);
return {
node: nodeRequire && !webCrypto ? nodeRequire("crypto") : undefined,
web: webCrypto
};
})();

0 comments on commit 8ba2b05

Please sign in to comment.