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

rsa-compat

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rsa-compat - npm Package Compare versions

Comparing version 1.5.1 to 1.6.0

2

lib/key-utils.js

@@ -29,3 +29,3 @@ // Copyright 2014 ISRG. All rights reserved

b64dec: function(str) {
return new Buffer(utils.toStandardB64(str), "base64");
return Buffer.from(utils.toStandardB64(str), "base64");
},

@@ -32,0 +32,0 @@

@@ -10,9 +10,3 @@ 'use strict';

}
var buf;
// See https://github.com/Daplie/rsa-compat.js/issues/9
try {
buf = Buffer.from(hex, 'hex');
} catch(e) {
buf = new Buffer(hex, 'hex');
}
var buf = Buffer.from(hex, 'hex');
var b64 = buf.toString('base64');

@@ -19,0 +13,0 @@ var b64Url = b64.replace(/[+]/g, "-").replace(/\//g, "_").replace(/=/g,"");

@@ -28,3 +28,3 @@ 'use strict';

var std64 = forgec._toStandardBase64(base64);
var hex = new Buffer(std64, 'base64').toString("hex");
var hex = Buffer.from(std64, 'base64').toString("hex");

@@ -31,0 +31,0 @@ return new forge.jsbn.BigInteger(hex, 16);

@@ -30,3 +30,3 @@ 'use strict';

[ 'n', 'e', 'p', 'q', 'dp', 'dq', 'qi', 'd' ].forEach(function (key) {
components.push(new Buffer(jwk[key], 'base64'));
components.push(Buffer.from(jwk[key], 'base64'));
});

@@ -39,3 +39,3 @@

[ 'n', 'e' ].forEach(function (key) {
components.push(new Buffer(jwk[key], 'base64'));
components.push(Buffer.from(jwk[key], 'base64'));
});

@@ -42,0 +42,0 @@

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

var forge = require("node-forge");
return new Buffer(forge.util.bytesToHex(bytes), "hex");
return Buffer.from(forge.util.bytesToHex(bytes), "hex");
};

@@ -50,3 +50,3 @@ RSA._internal = require('./lib/node');//.create(deps);

// #L147 const rsaThumbprintTemplate = `{"e":"%s","kty":"RSA","n":"%s"}`
return new Buffer('{"e":"'+ e + '","kty":"RSA","n":"'+ n +'"}', 'ascii');
return Buffer.from('{"e":"'+ e + '","kty":"RSA","n":"'+ n +'"}', 'ascii');
};

@@ -181,3 +181,3 @@ RSA.thumbprint = function (keypair) {

var sig64 = RSA.utils.toWebsafeBase64(
new Buffer(forge.util.bytesToHex(sigF), "hex").toString('base64')
Buffer.from(forge.util.bytesToHex(sigF), "hex").toString('base64')
);

@@ -215,3 +215,3 @@

}
var protected64 = RSA.utils.toWebsafeBase64(new Buffer(protectedHeader).toString('base64'));
var protected64 = RSA.utils.toWebsafeBase64(Buffer.from(protectedHeader).toString('base64'));
var payload64 = RSA.utils.toWebsafeBase64(payload.toString('base64'));

@@ -218,0 +218,0 @@ var raw = protected64 + "." + payload64;

{
"name": "rsa-compat",
"version": "1.5.1",
"version": "1.6.0",
"description": "RSA utils that work on Windows, Mac, and Linux with or without C compiler",

@@ -23,11 +23,5 @@ "main": "node.js",

"ssl",
"javascript",
"js",
"node",
"node.js",
"windows",
"mac",
"linux",
"macOS",
"win",
"key",

@@ -43,11 +37,8 @@ "jwk"

"dependencies": {
"node-forge": "^0.6.41"
"node-forge": "^0.7.6",
"ursa-optional": "^0.9.6"
},
"optionalDependencies": {
},
"trulyOptionalDependencies": {
"buffer-v6-polyfill": "^1.0.3",
"ursa": "^0.9.4",
"ursa-optional": "^0.9.4"
"buffer-v6-polyfill": "^1.0.3"
}
}

@@ -50,3 +50,3 @@ 'use strict';

keypair
, new Buffer('24bcc5d4d04d095de47db279b05685c97f787c9b8bd87f88cdaa0137e7228879', 'hex')
, Buffer.from('24bcc5d4d04d095de47db279b05685c97f787c9b8bd87f88cdaa0137e7228879', 'hex')
, '8ef5624f5ec9d3ef'

@@ -53,0 +53,0 @@ );

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