Skip to content
This repository has been archived by the owner on Jul 27, 2019. It is now read-only.

Remove "node-uuid" dependency for salt #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var http = require('http');
var uuid = require('node-uuid');
//var uuid = require('node-uuid');
var crypto = require('crypto');

var apiKeys = require('../../apiKeys.js');
Expand Down Expand Up @@ -29,7 +29,8 @@ function getAuthObj() {
}

function getSalt() {
return uuid.v4();
//return uuid.v4();
return crypto.randomBytes(20).toString('hex');
}

function getUnixTimestamp() {
Expand All @@ -41,4 +42,4 @@ function getSignature(key, secret, timestamp, salt, encryptionMethod) {
let sig = key + secret + timestamp + salt;

return crypto.createHash(encryptionMethod).update(sig).digest('hex');
}
}