warn raspberry pi (ARM) users of slowness
This commit is contained in:
parent
4de65e1053
commit
f9d4c28952
17
node.js
17
node.js
|
@ -43,6 +43,23 @@ function create(deps) {
|
||||||
};
|
};
|
||||||
|
|
||||||
RSA.generateKeypair = function (length, exponent, options, cb) {
|
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 = {
|
var keypair = {
|
||||||
privateKeyPem: undefined
|
privateKeyPem: undefined
|
||||||
, publicKeyPem: undefined
|
, publicKeyPem: undefined
|
||||||
|
|
Loading…
Reference in New Issue