X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=node_modules%2Fphantomjs-prebuilt%2Fnode_modules%2Fuuid%2Fv4.js;fp=node_modules%2Fphantomjs-prebuilt%2Fnode_modules%2Fuuid%2Fv4.js;h=38b6f76a985a7bfd52e63b44b61fc7fa8d7535a1;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/node_modules/phantomjs-prebuilt/node_modules/uuid/v4.js b/node_modules/phantomjs-prebuilt/node_modules/uuid/v4.js new file mode 100644 index 000000000..38b6f76a9 --- /dev/null +++ b/node_modules/phantomjs-prebuilt/node_modules/uuid/v4.js @@ -0,0 +1,29 @@ +var rng = require('./lib/rng'); +var bytesToUuid = require('./lib/bytesToUuid'); + +function v4(options, buf, offset) { + var i = buf && offset || 0; + + if (typeof(options) == 'string') { + buf = options == 'binary' ? new Array(16) : null; + options = null; + } + options = options || {}; + + var rnds = options.random || (options.rng || rng)(); + + // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + rnds[6] = (rnds[6] & 0x0f) | 0x40; + rnds[8] = (rnds[8] & 0x3f) | 0x80; + + // Copy bytes to buffer, if provided + if (buf) { + for (var ii = 0; ii < 16; ++ii) { + buf[i + ii] = rnds[ii]; + } + } + + return buf || bytesToUuid(rnds); +} + +module.exports = v4;