Создать расширяемую платформу Муром 1.2
This commit is contained in:
13
модули/муром.uuid_1.0.0.js
Normal file
13
модули/муром.uuid_1.0.0.js
Normal file
@@ -0,0 +1,13 @@
|
||||
// Create GUID / UUID in JavaScript?
|
||||
// https://stackoverflow.com/a/2117523
|
||||
муром.uuid = function()
|
||||
{
|
||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(
|
||||
/[xy]/g,
|
||||
function(c)
|
||||
{
|
||||
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
|
||||
return v.toString(16);
|
||||
}
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user