Commit 75654d09 authored by Sindre Sorhus's avatar Sindre Sorhus

Found a smaller and faster UUID function, use it instead.

parent 6244a055
...@@ -8,18 +8,8 @@ jQuery(function($) { ...@@ -8,18 +8,8 @@ jQuery(function($) {
"use strict"; "use strict";
var Utils = { var Utils = {
// https://gist.github.com/823878 // https://gist.github.com/1308368
uuid: function() { uuid: function(a,b){for(b=a='';a++<36;b+=a*51&52?(a^15?8^Math.random()*(a^20?16:4):4).toString(16):'-');return b},
var uuid = "", i, random;
for ( i = 0; i < 32; i++ ) {
random = Math.random() * 16 | 0;
if ( i === 8 || i === 12 || i === 16 || i === 20 ) {
uuid += "-";
}
uuid += ( i === 12 ? 4 : ( i === 16 ? ( random & 3 | 8 ) : random ) ).toString(16);
}
return uuid;
},
pluralize: function( count, word ) { pluralize: function( count, word ) {
return count === 1 ? word : word + 's'; return count === 1 ? word : word + 's';
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment