You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
552 B

4 years ago
  1. var crypto = require('crypto')
  2. if (typeof crypto.publicEncrypt !== 'function') {
  3. crypto = require('./browser')
  4. }
  5. exports.publicEncrypt = crypto.publicEncrypt
  6. exports.privateDecrypt = crypto.privateDecrypt
  7. if (typeof crypto.privateEncrypt !== 'function') {
  8. exports.privateEncrypt = require('./browser').privateEncrypt
  9. } else {
  10. exports.privateEncrypt = crypto.privateEncrypt
  11. }
  12. if (typeof crypto.publicDecrypt !== 'function') {
  13. exports.publicDecrypt = require('./browser').publicDecrypt
  14. } else {
  15. exports.publicDecrypt = crypto.publicDecrypt
  16. }