Skip to content

Commit

Permalink
Merge branch 'master' into 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rattletone committed Jun 18, 2019
2 parents a65137d + af40000 commit 55cde76
Show file tree
Hide file tree
Showing 3 changed files with 515 additions and 506 deletions.
22 changes: 21 additions & 1 deletion lib/ApiRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,27 @@ class ApiRequest {
sign(secret) {
const params = Object
.entries(this)
.sort(([nameA], [nameB]) => nameA.localeCompare(nameB));
.sort(([a], [b]) => {
for(let i = 0; i < a.length && i < b.length; i++) {
if(a.charCodeAt(i) < b.charCodeAt(i)) {
return -1;
}

if(a.charCodeAt(i) > b.charCodeAt(i)) {
return 1;
}
}

if(a.length > b.length) {
return -1;
}

if(a.length < b.length) {
return 1;
}

return 0;
});

let paramString = "";

Expand Down
Loading

0 comments on commit 55cde76

Please sign in to comment.