Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-rsa

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-rsa - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

9

.tmp/brow.js

@@ -44,7 +44,12 @@ var NodeRSA = require('../src/NodeRSA');

var key;
onmessage = function(e) {
if (e.data.command === 'newKey') {
var key = new NodeRSA(e.data.params);
postMessage(key.exportKey());
key = new NodeRSA(e.data.params);
postMessage({command:e.data.command, data: key.exportKey()});
}
if (e.data.command === 'sign') {
postMessage({command:e.data.command, data: key.sign(e.data.data, 'base64', 'utf8')});
}
};

@@ -5,5 +5,11 @@ var myWorker = new Worker("bundle.js");

console.log('Message received from worker');
console.log(e);
if (e.data.command === 'newKey') {
console.log(e.data.data);
myWorker.postMessage({command: 'sign', data: "hellooooo"});
}
if (e.data.command === 'sign') {
console.log(e.data.data);
}
};
myWorker.postMessage({command: 'newKey', params: {b: 2048}});
myWorker.postMessage({command: 'newKey', params: {b: 1024}});
{
"name": "node-rsa",
"version": "0.3.1",
"version": "0.3.2",
"description": "Node.js RSA library",

@@ -5,0 +5,0 @@ "main": "src/NodeRSA.js",

@@ -240,3 +240,3 @@ # Node-RSA

### 0.3.1
### 0.3.2
* Fixed environment detection in web worker.

@@ -243,0 +243,0 @@

@@ -188,3 +188,3 @@ /*!

* Exporting key
* @param format {string}
* @param [format] {string}
*/

@@ -191,0 +191,0 @@ NodeRSA.prototype.exportKey = function (format) {

@@ -117,3 +117,3 @@ /**

var hashAlgorithm = this.options.signingSchemeOptions.hash || DEFAULT_HASH_FUNCTION;
if (this.options.environment == 'browser') {
if (this.options.environment === 'browser') {
hashAlgorithm = SIGN_ALG_TO_HASH_ALIASES[hashAlgorithm] || hashAlgorithm;

@@ -136,3 +136,3 @@

var hashAlgorithm = this.options.signingSchemeOptions.hash || DEFAULT_HASH_FUNCTION;
if (this.options.environment == 'browser') {
if (this.options.environment === 'browser') {
hashAlgorithm = SIGN_ALG_TO_HASH_ALIASES[hashAlgorithm] || hashAlgorithm;

@@ -139,0 +139,0 @@

@@ -15,3 +15,3 @@ /*

module.exports.linebrk = function (str, maxLen) {
var res = "";
var res = '';
var i = 0;

@@ -26,7 +26,6 @@ while (i + maxLen < str.length) {

module.exports.detectEnvironment = function () {
if (process && process.title != 'browser') {
return 'node';
} else if (typeof(window) !== 'undefined' && window) {
if (process && process.title === 'browser' || (typeof(window) !== 'undefined' && window)) {
return 'browser';
}
return 'node';

@@ -33,0 +32,0 @@ };

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc