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

karl-common-util

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

karl-common-util - npm Package Compare versions

Comparing version 1.3.7 to 1.3.8

37

dist/http/index.js

@@ -7,4 +7,2 @@ "use strict";

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
require("isomorphic-fetch");

@@ -338,38 +336,3 @@

}, null, undefined);
},
buildAuthorization: function buildAuthorization(_ref3) {
var data = _ref3.data,
key = _ref3.key;
var arr = [];
for (var k in data) {
arr.push({ k: k, v: data[k] });
}
arr.sort(function (a, b) {
//按小写的key进行排序
var ak = a.k.toLowerCase();
var bk = b.k.toLowerCase();
if (ak < bk) {
return -1;
}
if (ak > bk) {
return 1;
}
return 0;
});
//对排序后的数组的值连接,末尾追加“avalon”字符串进行md5签名
var hash = crypto.createHash("md5");
var sign = arr.map(function (d) {
if (_typeof(d.v) === "object") {
return JSON.stringify(d.v);
} else {
return d.v;
}
}).join("");
sign += key;
hash.update(sign);
sign = hash.digest("hex");
sign = "Bearer " + sign;
return sign;
}
};

2

package.json
{
"name": "karl-common-util",
"version": "1.3.7",
"version": "1.3.8",
"description": "karl common lib for client and server",

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

@@ -148,34 +148,2 @@ import "isomorphic-fetch"

},
buildAuthorization: ({data, key}) => {
let arr = []
for (let k in data) {
arr.push({k: k, v: data[k]})
}
arr.sort((a, b) => {
//按小写的key进行排序
let ak = a.k.toLowerCase()
let bk = b.k.toLowerCase()
if (ak < bk) {
return -1
}
if (ak > bk) {
return 1
}
return 0
})
//对排序后的数组的值连接,末尾追加“avalon”字符串进行md5签名
let hash = crypto.createHash("md5")
let sign = arr.map(d => {
if(typeof (d.v) === "object"){
return JSON.stringify(d.v)
}else {
return d.v
}
}).join("")
sign += key
hash.update(sign)
sign = hash.digest("hex")
sign = "Bearer " + sign
return sign
}
}
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