mirror of
https://github.com/keeweb/keeweb.git
synced 2024-06-27 07:45:08 +02:00
14 lines
337 B
JavaScript
14 lines
337 B
JavaScript
'use strict';
|
|
|
|
var IdGenerator = {
|
|
uuid: function() {
|
|
var s4 = IdGenerator.s4;
|
|
return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
|
|
},
|
|
s4: function() {
|
|
return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
|
|
}
|
|
};
|
|
|
|
module.exports = IdGenerator;
|