mirror of
https://github.com/wu736139669/vczero.github.io.git
synced 2026-08-05 06:23:38 +00:00
add com..
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Inspired from the book of JavaScript Patterns, Stoyan Stefanov.
|
||||
* You can add some special value in this guid, such as user's email or nickname or id.
|
||||
* @module guid for JavaScript client
|
||||
*/
|
||||
(function(exports){
|
||||
exports.guid = {
|
||||
'create': 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);
|
||||
}).toUpperCase();
|
||||
}
|
||||
};
|
||||
})(window);
|
||||
Reference in New Issue
Block a user