mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
wip: split shared ops
This commit is contained in:
9
common/script/libs/uuid.js
Normal file
9
common/script/libs/uuid.js
Normal file
@@ -0,0 +1,9 @@
|
||||
// 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);
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user