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

hm-crypto-nodejs

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hm-crypto-nodejs - npm Package Compare versions

Comparing version 1.0.0 to 1.0.2

17

lib/hm-crypto.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const crypto_1 = require("crypto");
class HmCrypto {
constructor(digestType, privateKey, publicKey) {
var crypto_1 = require("crypto");
var HmCrypto = /** @class */ (function () {
function HmCrypto(digestType, privateKey, publicKey) {
this.defaultDigestType = digestType;

@@ -10,14 +10,15 @@ this.defaultPrivateKey = privateKey;

}
sign(message, digestType, privateKey) {
HmCrypto.prototype.sign = function (message, digestType, privateKey) {
digestType = digestType || this.defaultDigestType;
privateKey = privateKey || this.defaultPrivateKey;
return crypto_1.createSign(digestType).update(message).sign(privateKey, "base64");
}
isValid(message, signature, digestType, publicKey) {
};
HmCrypto.prototype.isValid = function (message, signature, digestType, publicKey) {
digestType = digestType || this.defaultDigestType;
publicKey = publicKey || this.defaultPublicKey;
return crypto_1.createVerify(digestType).update(message).verify(publicKey, signature, 'base64');
}
}
};
return HmCrypto;
}());
exports.HmCrypto = HmCrypto;
//# sourceMappingURL=hm-crypto.js.map
{
"name": "hm-crypto-nodejs",
"version": "1.0.0",
"version": "1.0.2",
"description": "Node.js library for signing and validating requests",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -7,3 +7,3 @@ {

"sourceMap": true,
"target": "es6"
"target": "es5"
},

@@ -10,0 +10,0 @@ "files": [

Sorry, the diff of this file is not supported yet

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