diff --git a/node.js b/node.js index fe6de54..7827f75 100644 --- a/node.js +++ b/node.js @@ -43,6 +43,23 @@ function create(deps) { }; RSA.generateKeypair = function (length, exponent, options, cb) { + if (!RSA._URSA && /arm|mips/i.test(require('os').arch) && !RSA._SLOW_WARN) { + console.warn("================================================================"); + console.warn(" WARNING"); + console.warn("================================================================"); + console.warn(""); + console.warn("WARNING: You are generating an RSA key using pure JavaScript on"); + console.warn(" a VERY SLOW cpu. This could take DOZENS of minutes!"); + console.warn(""); + console.warn(" We recommend installing a C compiler and 'ursa'"); + console.warn(""); + console.warn("EXAMPLE:"); + console.warn(""); + console.warn(" sudo apt-get install build-essential && npm install ursa"); + console.warn(""); + console.warn("================================================================"); + RSA._SLOW_WARN = true; + } var keypair = { privateKeyPem: undefined , publicKeyPem: undefined