multi-process-session
Version:
manage multi process session
23 lines (17 loc) • 439 B
JavaScript
// Generated by CoffeeScript 2.3.1
(function() {
var crypto, genSID, uuid;
crypto = require('crypto');
uuid = require("node-uuid");
genSID = function(secret) {
var hmac, id;
if (!secret) {
throw new Error('need secret');
}
hmac = crypto.createHmac('sha1', secret);
id = uuid.v4();
hmac.update(new Buffer(id, 'utf8'));
return hmac.digest('hex');
};
exports.genSID = genSID;
}).call(this);