mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
18 lines
344 B
JavaScript
18 lines
344 B
JavaScript
(function () {
|
|
var ns = $.namespace('pskl.utils');
|
|
|
|
var s4 = function () {
|
|
return Math.floor((1 + Math.random()) * 0x10000)
|
|
.toString(16)
|
|
.substring(1);
|
|
};
|
|
|
|
ns.Uuid = {
|
|
generate : function () {
|
|
return 'ss-s-s-s-sss'.replace(/s/g, function () {
|
|
return s4();
|
|
});
|
|
}
|
|
};
|
|
})();
|