Skip to content

Instantly share code, notes, and snippets.

@DSchougaard
Created February 23, 2016 11:16
Show Gist options
  • Save DSchougaard/1ada363449617940358d to your computer and use it in GitHub Desktop.
Save DSchougaard/1ada363449617940358d to your computer and use it in GitHub Desktop.
// generate an RSA key pair asynchronously (uses web workers if available)
// use workers: -1 to run a fast core estimator to optimize # of workers
rsa.generateKeyPair({bits: 2048, workers: 2}, function(err, keypair) {
// keypair.privateKey, keypair.publicKey
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment