uuid-random
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -34,3 +34,7 @@ "use strict"; | ||
_crypto = crypto; | ||
} | ||
} else if( (typeof window !== 'undefined') && (typeof window.msCrypto !== 'undefined')) { | ||
// IE11 | ||
_crypto = window.msCrypto; | ||
} | ||
if ((typeof module !== 'undefined') && (typeof require === 'function')) { | ||
@@ -37,0 +41,0 @@ _crypto = _crypto || require('crypto'); |
{ | ||
"name": "uuid-random", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "Fastest UUIDv4 with good RNG", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,1 +0,1 @@ | ||
"use strict";!function(){var r,t,n,e=0,o=[];for(f.BUFFER_SIZE=512,f.bin=i,f.test=function(r){if("string"==typeof r)return/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/.test(r)},t=0;t<256;t++)o[t]=(t+256).toString(16).substr(1);function i(){var o=function(o){var i,u,a;if(void 0!==n){if(void 0===r||e+o>f.BUFFER_SIZE)if(e=0,n.getRandomValues)r=new Uint8Array(f.BUFFER_SIZE),n.getRandomValues(r);else{if(!n.randomBytes)throw new Error("Non-standard crypto library");r=n.randomBytes(f.BUFFER_SIZE)}return r.slice(e,e+=o)}for(i=[],t=0;t<o;t++)i.push((u=0,a=255,Math.floor(Math.random()*(a-u))+u));return i}(16);return o[6]=15&o[6]|64,o[8]=63&o[8]|128,o}function f(){var r=i();return o[r[0]]+o[r[1]]+o[r[2]]+o[r[3]]+"-"+o[r[4]]+o[r[5]]+"-"+o[r[6]]+o[r[7]]+"-"+o[r[8]]+o[r[9]]+"-"+o[r[10]]+o[r[11]]+o[r[12]]+o[r[13]]+o[r[14]]+o[r[15]]}"undefined"!=typeof crypto&&(n=crypto),"undefined"!=typeof module&&"function"==typeof require?(n=n||require("crypto"),module.exports=f):"undefined"!=typeof window&&(window.uuid=f)}(); | ||
"use strict";!function(){var r,n,t,o=0,e=[];for(f.BUFFER_SIZE=512,f.bin=i,f.test=function(r){if("string"==typeof r)return/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/.test(r)},n=0;n<256;n++)e[n]=(n+256).toString(16).substr(1);function i(){var e=function(e){var i,d,u;if(void 0!==t){if(void 0===r||o+e>f.BUFFER_SIZE)if(o=0,t.getRandomValues)r=new Uint8Array(f.BUFFER_SIZE),t.getRandomValues(r);else{if(!t.randomBytes)throw new Error("Non-standard crypto library");r=t.randomBytes(f.BUFFER_SIZE)}return r.slice(o,o+=e)}for(i=[],n=0;n<e;n++)i.push((d=0,u=255,Math.floor(Math.random()*(u-d))+d));return i}(16);return e[6]=15&e[6]|64,e[8]=63&e[8]|128,e}function f(){var r=i();return e[r[0]]+e[r[1]]+e[r[2]]+e[r[3]]+"-"+e[r[4]]+e[r[5]]+"-"+e[r[6]]+e[r[7]]+"-"+e[r[8]]+e[r[9]]+"-"+e[r[10]]+e[r[11]]+e[r[12]]+e[r[13]]+e[r[14]]+e[r[15]]}"undefined"!=typeof crypto?t=crypto:"undefined"!=typeof window&&void 0!==window.msCrypto&&(t=window.msCrypto),"undefined"!=typeof module&&"function"==typeof require?(t=t||require("crypto"),module.exports=f):"undefined"!=typeof window&&(window.uuid=f)}(); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16783
18
307