use uuid module for uuids

This commit is contained in:
Matteo Pagliazzi
2016-05-01 15:01:00 +02:00
parent 590e185ecd
commit a0e63c0eb2
2 changed files with 2 additions and 10 deletions

View File

@@ -1,9 +1 @@
// TODO use node-uuid module
module.exports = function() {
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
var r, v;
r = Math.random() * 16 | 0;
v = (c === "x" ? r : r & 0x3 | 0x8);
return v.toString(16);
});
};
module.exports = require('uuid').v4;