1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Base64 encoding of meshid/nodeid in the database.

This commit is contained in:
Ylian Saint-Hilaire 2017-10-15 17:36:06 -07:00
parent 1952d75860
commit ace4046415
7 changed files with 47 additions and 68 deletions

View file

@ -4,15 +4,6 @@
* @version v0.0.1
*/
// Construct a MeshRelay object, called upon connection
module.exports.CreateMeshRelayKey = function (parent, func) {
parent.crypto.randomBytes(48, function (err, buf) {
var key = buf.toString('hex').toUpperCase() + ':' + Date.now();
key += ':' + parent.crypto.createHmac('SHA384', parent.relayRandom).update(key).digest('hex');
func(key);
});
}
module.exports.CreateMeshRelay = function (parent, ws, req) {
var obj = {};
obj.ws = ws;