From 34eaf5c90ef315227114994a00d43228b33b55aa Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Sun, 6 Jul 2014 01:07:50 +0200 Subject: Use node-uuid for true uuids --- webcastor.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'webcastor.js') diff --git a/webcastor.js b/webcastor.js index 8dabe52..39c37a9 100644 --- a/webcastor.js +++ b/webcastor.js @@ -29,6 +29,7 @@ var imports = { redis : require('redis'), passwordHash : require('password-hash'), + uuid : require('node-uuid'), }; var params = { @@ -69,7 +70,7 @@ var Channel = { }, open : function(name, password) { - var hashedPassword + var hashedPassword; if (password === '') { hashedPassword = 'none'; } else { @@ -79,12 +80,7 @@ var Channel = { }, generateUniqueName : function() { - var uniqueName; - while (uniqueName === this.previousName) { - uniqueName = (+new Date()).toString(36).toUpperCase(); - } - this.previousName = uniqueName; - return uniqueName; + return imports.uuid.v1(); }, getPassword : function(name, callback) { -- cgit v1.2.3