cryptoNode.js 579 B

123456789101112131415161718
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.crypto = void 0;
  4. /**
  5. * Internal webcrypto alias.
  6. * We prefer WebCrypto aka globalThis.crypto, which exists in node.js 16+.
  7. * Falls back to Node.js built-in crypto for Node.js <=v14.
  8. * See utils.ts for details.
  9. * @module
  10. */
  11. // @ts-ignore
  12. const nc = require("node:crypto");
  13. exports.crypto = nc && typeof nc === 'object' && 'webcrypto' in nc
  14. ? nc.webcrypto
  15. : nc && typeof nc === 'object' && 'randomBytes' in nc
  16. ? nc
  17. : undefined;
  18. //# sourceMappingURL=cryptoNode.js.map