first commit
This commit is contained in:
46
build/node_modules/uuid/.eslintrc.json
generated
vendored
Normal file
46
build/node_modules/uuid/.eslintrc.json
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"root": true,
|
||||
"env": {
|
||||
"browser": true,
|
||||
"commonjs": true,
|
||||
"node": true,
|
||||
"mocha": true
|
||||
},
|
||||
"extends": ["eslint:recommended"],
|
||||
"installedESLint": true,
|
||||
"rules": {
|
||||
"array-bracket-spacing": ["warn", "never"],
|
||||
"arrow-body-style": ["warn", "as-needed"],
|
||||
"arrow-parens": ["warn", "as-needed"],
|
||||
"arrow-spacing": "warn",
|
||||
"brace-style": "warn",
|
||||
"camelcase": "warn",
|
||||
"comma-spacing": ["warn", {"after": true}],
|
||||
"dot-notation": "warn",
|
||||
"indent": ["warn", 2, {
|
||||
"SwitchCase": 1,
|
||||
"FunctionDeclaration": {"parameters": 1},
|
||||
"MemberExpression": 1,
|
||||
"CallExpression": {"arguments": 1}
|
||||
}],
|
||||
"key-spacing": ["warn", {"beforeColon": false, "afterColon": true, "mode": "minimum"}],
|
||||
"keyword-spacing": "warn",
|
||||
"no-console": "off",
|
||||
"no-empty": "off",
|
||||
"no-multi-spaces": "warn",
|
||||
"no-redeclare": "off",
|
||||
"no-restricted-globals": ["warn", "Promise"],
|
||||
"no-trailing-spaces": "warn",
|
||||
"no-undef": "error",
|
||||
"no-unused-vars": ["warn", {"args": "none"}],
|
||||
"padded-blocks": ["warn", "never"],
|
||||
"object-curly-spacing": ["warn", "never"],
|
||||
"quotes": ["warn", "single"],
|
||||
"react/prop-types": "off",
|
||||
"react/jsx-no-bind": "off",
|
||||
"semi": ["warn", "always"],
|
||||
"space-before-blocks": ["warn", "always"],
|
||||
"space-before-function-paren": ["warn", "never"],
|
||||
"space-in-parens": ["warn", "never"]
|
||||
}
|
||||
}
|
||||
5
build/node_modules/uuid/AUTHORS
generated
vendored
Normal file
5
build/node_modules/uuid/AUTHORS
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
Robert Kieffer <robert@broofa.com>
|
||||
Christoph Tavan <dev@tavan.de>
|
||||
AJ ONeal <coolaj86@gmail.com>
|
||||
Vincent Voyer <vincent@zeroload.net>
|
||||
Roman Shtylman <shtylman@gmail.com>
|
||||
28
build/node_modules/uuid/HISTORY.md
generated
vendored
Normal file
28
build/node_modules/uuid/HISTORY.md
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
# 3.0.1 (2016-11-28)
|
||||
|
||||
* split uuid versions into separate files
|
||||
|
||||
# 3.0.0 (2016-11-17)
|
||||
|
||||
* remove .parse and .unparse
|
||||
|
||||
# 2.0.0
|
||||
|
||||
* Removed uuid.BufferClass
|
||||
|
||||
# 1.4.0
|
||||
|
||||
* Improved module context detection
|
||||
* Removed public RNG functions
|
||||
|
||||
# 1.3.2
|
||||
|
||||
* Improve tests and handling of v1() options (Issue #24)
|
||||
* Expose RNG option to allow for perf testing with different generators
|
||||
|
||||
# 1.3.0
|
||||
|
||||
* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)!
|
||||
* Support for node.js crypto API
|
||||
* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code
|
||||
|
||||
21
build/node_modules/uuid/LICENSE.md
generated
vendored
Normal file
21
build/node_modules/uuid/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2010-2016 Robert Kieffer and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
227
build/node_modules/uuid/README.md
generated
vendored
Normal file
227
build/node_modules/uuid/README.md
generated
vendored
Normal file
@@ -0,0 +1,227 @@
|
||||
# uuid [](http://travis-ci.org/kelektiv/node-uuid) #
|
||||
|
||||
Simple, fast generation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDS.
|
||||
|
||||
Features:
|
||||
|
||||
* Support for version 1, 4 and 5 UUIDs
|
||||
* Cross-platform
|
||||
* Uses cryptographically-strong random number APIs (when available)
|
||||
* Zero-dependency, small footprint (... but not [this small](https://gist.github.com/982883))
|
||||
|
||||
## Quickstart - CommonJS (Recommended)
|
||||
|
||||
```shell
|
||||
npm install uuid
|
||||
```
|
||||
|
||||
Then generate your uuid version of choice ...
|
||||
|
||||
Version 1 (timestamp):
|
||||
|
||||
```javascript
|
||||
const uuidv1 = require('uuid/v1');
|
||||
uuidv1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'
|
||||
```
|
||||
|
||||
Version 4 (random):
|
||||
|
||||
```javascript
|
||||
const uuidv4 = require('uuid/v4');
|
||||
uuidv4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1'
|
||||
```
|
||||
|
||||
Version 5 (namespace):
|
||||
|
||||
```javascript
|
||||
const uuidv5 = require('uuid/v5');
|
||||
|
||||
// ... using predefined DNS namespace (for domain names)
|
||||
uuidv5('hello.example.com', uuidv5.DNS)); // -> 'fdda765f-fc57-5604-a269-52a7df8164ec'
|
||||
|
||||
// ... using predefined URL namespace (for, well, URLs)
|
||||
uuidv5('http://example.com/hello', uuidv5.URL); // -> '3bbcee75-cecc-5b56-8031-b6641c1ed1f1'
|
||||
|
||||
// ... using a custom namespace
|
||||
const MY_NAMESPACE = '<UUID string you previously generated elsewhere>';
|
||||
uuidv5('Hello, World!', MY_NAMESPACE); // -> '90123e1c-7512-523e-bb28-76fab9f2f73d'
|
||||
```
|
||||
|
||||
## Quickstart - Browser-ready Versions
|
||||
|
||||
Browser-ready versions of this module are available via [wzrd.in](https://github.com/jfhbrook/wzrd.in).
|
||||
|
||||
For version 1 uuids:
|
||||
|
||||
```html
|
||||
<script src="http://wzrd.in/standalone/uuid%2Fv1@latest"></script>
|
||||
<script>
|
||||
uuidv1(); // -> v1 UUID
|
||||
</script>
|
||||
```
|
||||
|
||||
For version 4 uuids:
|
||||
|
||||
```html
|
||||
<script src="http://wzrd.in/standalone/uuid%2Fv4@latest"></script>
|
||||
<script>
|
||||
uuidv4(); // -> v4 UUID
|
||||
</script>
|
||||
```
|
||||
|
||||
For version 5 uuids:
|
||||
|
||||
```html
|
||||
<script src="http://wzrd.in/standalone/uuid%2Fv5@latest"></script>
|
||||
<script>
|
||||
uuidv5('http://example.com/hello', uuidv5.URL); // -> v5 UUID
|
||||
</script>
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### Version 1
|
||||
|
||||
```javascript
|
||||
const uuidv1 = require('uuid/v1');
|
||||
|
||||
// Allowed arguments
|
||||
uuidv1();
|
||||
uuidv1(options);
|
||||
uuidv1(options, buffer, offset);
|
||||
```
|
||||
|
||||
Generate and return a RFC4122 v1 (timestamp-based) UUID.
|
||||
|
||||
* `options` - (Object) Optional uuid state to apply. Properties may include:
|
||||
|
||||
* `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1.
|
||||
* `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used.
|
||||
* `msecs` - (Number | Date) Time in milliseconds since unix Epoch. Default: The current time is used.
|
||||
* `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2.
|
||||
|
||||
* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.
|
||||
* `offset` - (Number) Starting index in `buffer` at which to begin writing.
|
||||
|
||||
Returns `buffer`, if specified, otherwise the string form of the UUID
|
||||
|
||||
Note: The <node> id is generated guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.)
|
||||
|
||||
Example: Generate string UUID with fully-specified options
|
||||
|
||||
```javascript
|
||||
uuidv1({
|
||||
node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],
|
||||
clockseq: 0x1234,
|
||||
msecs: new Date('2011-11-01').getTime(),
|
||||
nsecs: 5678
|
||||
}); // -> "710b962e-041c-11e1-9234-0123456789ab"
|
||||
```
|
||||
|
||||
Example: In-place generation of two binary IDs
|
||||
|
||||
```javascript
|
||||
// Generate two ids in an array
|
||||
const arr = new Array(32); // -> []
|
||||
uuidv1(null, arr, 0); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15]
|
||||
uuidv1(null, arr, 16); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15]
|
||||
```
|
||||
|
||||
### Version 4
|
||||
|
||||
```javascript
|
||||
const uuidv4 = require('uuid/v4')
|
||||
|
||||
// Allowed arguments
|
||||
uuidv4();
|
||||
uuidv4(options);
|
||||
uuidv4(options, buffer, offset);
|
||||
```
|
||||
|
||||
Generate and return a RFC4122 v4 UUID.
|
||||
|
||||
* `options` - (Object) Optional uuid state to apply. Properties may include:
|
||||
* `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values
|
||||
* `rng` - (Function) Random # generator function that returns an Array[16] of byte values (0-255)
|
||||
* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.
|
||||
* `offset` - (Number) Starting index in `buffer` at which to begin writing.
|
||||
|
||||
Returns `buffer`, if specified, otherwise the string form of the UUID
|
||||
|
||||
Example: Generate string UUID with fully-specified options
|
||||
|
||||
```javascript
|
||||
uuid.v4({
|
||||
random: [
|
||||
0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea,
|
||||
0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36
|
||||
]
|
||||
});
|
||||
// -> "109156be-c4fb-41ea-b1b4-efe1671c5836"
|
||||
```
|
||||
|
||||
Example: Generate two IDs in a single buffer
|
||||
|
||||
```javascript
|
||||
const buffer = new Array(32); // (or 'new Buffer' in node.js)
|
||||
uuid.v4(null, buffer, 0);
|
||||
uuid.v4(null, buffer, 16);
|
||||
```
|
||||
|
||||
### Version 5
|
||||
|
||||
```javascript
|
||||
const uuidv5 = require('uuid/v4');
|
||||
|
||||
// Allowed arguments
|
||||
uuidv5(name, namespace);
|
||||
uuidv5(name, namespace, buffer);
|
||||
uuidv5(name, namespace, buffer, offset);
|
||||
```
|
||||
|
||||
Generate and return a RFC4122 v4 UUID.
|
||||
|
||||
* `name` - (String | Array[]) "name" to create UUID with
|
||||
* `namespace` - (String | Array[]) "namespace" UUID either as a String or Array[16] of byte values
|
||||
* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.
|
||||
* `offset` - (Number) Starting index in `buffer` at which to begin writing. Default = 0
|
||||
|
||||
Returns `buffer`, if specified, otherwise the string form of the UUID
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
// Generate a unique namespace (typically you would do this once, outside of
|
||||
// your project, then bake this value into your code)
|
||||
const uuidv4 = require('uuid/v4');
|
||||
const MY_NAMESPACE = uuidv4(); //
|
||||
|
||||
// Generate a couple namespace uuids
|
||||
const uuidv5 = require('uuid/v5');
|
||||
uuidv5('hello', MY_NAMESPACE);
|
||||
uuidv5('world', MY_NAMESPACE);
|
||||
```
|
||||
|
||||
## Testing
|
||||
|
||||
```shell
|
||||
npm test
|
||||
```
|
||||
|
||||
## Deprecated / Browser-ready API
|
||||
|
||||
The API below is available for legacy purposes and is not expected to be available post-3.X
|
||||
|
||||
```javascript
|
||||
const uuid = require('uuid');
|
||||
|
||||
uuid.v1(...); // alias of uuid/v1
|
||||
uuid.v4(...); // alias of uuid/v4
|
||||
uuid(...); // alias of uuid/v4
|
||||
|
||||
// uuid.v5() is not supported in this API
|
||||
```
|
||||
|
||||
## Legacy node-uuid package
|
||||
|
||||
The code for the legacy node-uuid package is available in the `node-uuid` branch.
|
||||
50
build/node_modules/uuid/bin/uuid
generated
vendored
Executable file
50
build/node_modules/uuid/bin/uuid
generated
vendored
Executable file
@@ -0,0 +1,50 @@
|
||||
#!/usr/bin/env node
|
||||
var assert = require('assert');
|
||||
|
||||
function usage() {
|
||||
console.log('Usage:');
|
||||
console.log(' uuid');
|
||||
console.log(' uuid v1');
|
||||
console.log(' uuid v4');
|
||||
console.log(' uuid v5 <name> <namespace uuid>');
|
||||
console.log(' uuid --help');
|
||||
console.log('\nNote: <namespace uuid> may be "URL" or "DNS" to use the corresponding UUIDs defined by RFC4122');
|
||||
}
|
||||
|
||||
var args = process.argv.slice(2);
|
||||
|
||||
if (args.indexOf('--help') >= 0) {
|
||||
usage();
|
||||
process.exit(0);
|
||||
}
|
||||
var version = args.shift() || 'v4';
|
||||
|
||||
switch (version) {
|
||||
case 'v1':
|
||||
var uuidV1 = require('../v1');
|
||||
console.log(uuidV1());
|
||||
break;
|
||||
|
||||
case 'v4':
|
||||
var uuidV4 = require('../v4');
|
||||
console.log(uuidV4());
|
||||
break;
|
||||
|
||||
case 'v5':
|
||||
var uuidV5 = require('../v5');
|
||||
|
||||
var name = args.shift();
|
||||
var namespace = args.shift();
|
||||
assert(name != null, 'v5 name not specified');
|
||||
assert(namespace != null, 'v5 namespace not specified');
|
||||
|
||||
if (namespace == 'URL') namespace = uuidV5.URL;
|
||||
if (namespace == 'DNS') namespace = uuidV5.DNS;
|
||||
|
||||
console.log(uuidV5(name, namespace));
|
||||
break;
|
||||
|
||||
default:
|
||||
usage();
|
||||
process.exit(1);
|
||||
}
|
||||
8
build/node_modules/uuid/index.js
generated
vendored
Normal file
8
build/node_modules/uuid/index.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
var v1 = require('./v1');
|
||||
var v4 = require('./v4');
|
||||
|
||||
var uuid = v4;
|
||||
uuid.v1 = v1;
|
||||
uuid.v4 = v4;
|
||||
|
||||
module.exports = uuid;
|
||||
23
build/node_modules/uuid/lib/bytesToUuid.js
generated
vendored
Normal file
23
build/node_modules/uuid/lib/bytesToUuid.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Convert array of 16 byte values to UUID string format of the form:
|
||||
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
||||
*/
|
||||
var byteToHex = [];
|
||||
for (var i = 0; i < 256; ++i) {
|
||||
byteToHex[i] = (i + 0x100).toString(16).substr(1);
|
||||
}
|
||||
|
||||
function bytesToUuid(buf, offset) {
|
||||
var i = offset || 0;
|
||||
var bth = byteToHex;
|
||||
return bth[buf[i++]] + bth[buf[i++]] +
|
||||
bth[buf[i++]] + bth[buf[i++]] + '-' +
|
||||
bth[buf[i++]] + bth[buf[i++]] + '-' +
|
||||
bth[buf[i++]] + bth[buf[i++]] + '-' +
|
||||
bth[buf[i++]] + bth[buf[i++]] + '-' +
|
||||
bth[buf[i++]] + bth[buf[i++]] +
|
||||
bth[buf[i++]] + bth[buf[i++]] +
|
||||
bth[buf[i++]] + bth[buf[i++]];
|
||||
}
|
||||
|
||||
module.exports = bytesToUuid;
|
||||
33
build/node_modules/uuid/lib/rng-browser.js
generated
vendored
Normal file
33
build/node_modules/uuid/lib/rng-browser.js
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
// Unique ID creation requires a high quality random # generator. In the
|
||||
// browser this is a little complicated due to unknown quality of Math.random()
|
||||
// and inconsistent support for the `crypto` API. We do the best we can via
|
||||
// feature-detection
|
||||
var rng;
|
||||
|
||||
var crypto = global.crypto || global.msCrypto; // for IE 11
|
||||
if (crypto && crypto.getRandomValues) {
|
||||
// WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
|
||||
var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
|
||||
rng = function whatwgRNG() {
|
||||
crypto.getRandomValues(rnds8);
|
||||
return rnds8;
|
||||
};
|
||||
}
|
||||
|
||||
if (!rng) {
|
||||
// Math.random()-based (RNG)
|
||||
//
|
||||
// If all else fails, use Math.random(). It's fast, but is of unspecified
|
||||
// quality.
|
||||
var rnds = new Array(16);
|
||||
rng = function() {
|
||||
for (var i = 0, r; i < 16; i++) {
|
||||
if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
|
||||
rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
|
||||
}
|
||||
|
||||
return rnds;
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = rng;
|
||||
10
build/node_modules/uuid/lib/rng.js
generated
vendored
Normal file
10
build/node_modules/uuid/lib/rng.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
// Unique ID creation requires a high quality random # generator. In node.js
|
||||
// this is pretty straight-forward - we use the crypto API.
|
||||
|
||||
var rb = require('crypto').randomBytes;
|
||||
|
||||
function rng() {
|
||||
return rb(16);
|
||||
}
|
||||
|
||||
module.exports = rng;
|
||||
85
build/node_modules/uuid/lib/sha1-browser.js
generated
vendored
Normal file
85
build/node_modules/uuid/lib/sha1-browser.js
generated
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
// Adapted from Chris Veness' SHA1 code at
|
||||
// http://www.movable-type.co.uk/scripts/sha1.html
|
||||
'use strict';
|
||||
|
||||
function f(s, x, y, z) {
|
||||
switch (s) {
|
||||
case 0: return (x & y) ^ (~x & z);
|
||||
case 1: return x ^ y ^ z;
|
||||
case 2: return (x & y) ^ (x & z) ^ (y & z);
|
||||
case 3: return x ^ y ^ z;
|
||||
}
|
||||
}
|
||||
|
||||
function ROTL(x, n) {
|
||||
return (x << n) | (x>>> (32 - n));
|
||||
}
|
||||
|
||||
function sha1(bytes) {
|
||||
var K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];
|
||||
var H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];
|
||||
|
||||
if (typeof(bytes) == 'string') {
|
||||
var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape
|
||||
bytes = new Array(msg.length);
|
||||
for (var i = 0; i < msg.length; i++) bytes[i] = msg.charCodeAt(i);
|
||||
}
|
||||
|
||||
bytes.push(0x80);
|
||||
|
||||
var l = bytes.length/4 + 2;
|
||||
var N = Math.ceil(l/16);
|
||||
var M = new Array(N);
|
||||
|
||||
for (var i=0; i<N; i++) {
|
||||
M[i] = new Array(16);
|
||||
for (var j=0; j<16; j++) {
|
||||
M[i][j] =
|
||||
bytes[i * 64 + j * 4] << 24 |
|
||||
bytes[i * 64 + j * 4 + 1] << 16 |
|
||||
bytes[i * 64 + j * 4 + 2] << 8 |
|
||||
bytes[i * 64 + j * 4 + 3];
|
||||
}
|
||||
}
|
||||
|
||||
M[N - 1][14] = ((bytes.length - 1) * 8) /
|
||||
Math.pow(2, 32); M[N - 1][14] = Math.floor(M[N - 1][14]);
|
||||
M[N - 1][15] = ((bytes.length - 1) * 8) & 0xffffffff;
|
||||
|
||||
for (var i=0; i<N; i++) {
|
||||
var W = new Array(80);
|
||||
|
||||
for (var t=0; t<16; t++) W[t] = M[i][t];
|
||||
for (var t=16; t<80; t++) {
|
||||
W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);
|
||||
}
|
||||
|
||||
var a = H[0], b = H[1], c = H[2], d = H[3], e = H[4];
|
||||
|
||||
for (var t=0; t<80; t++) {
|
||||
var s = Math.floor(t/20);
|
||||
var T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t] >>> 0;
|
||||
e = d;
|
||||
d = c;
|
||||
c = ROTL(b, 30) >>> 0;
|
||||
b = a;
|
||||
a = T;
|
||||
}
|
||||
|
||||
H[0] = (H[0] + a) >>> 0;
|
||||
H[1] = (H[1] + b) >>> 0;
|
||||
H[2] = (H[2] + c) >>> 0;
|
||||
H[3] = (H[3] + d) >>> 0;
|
||||
H[4] = (H[4] + e) >>> 0;
|
||||
}
|
||||
|
||||
return [
|
||||
H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff,
|
||||
H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff,
|
||||
H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff,
|
||||
H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff,
|
||||
H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff
|
||||
];
|
||||
}
|
||||
|
||||
module.exports = sha1;
|
||||
21
build/node_modules/uuid/lib/sha1.js
generated
vendored
Normal file
21
build/node_modules/uuid/lib/sha1.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
'use strict';
|
||||
|
||||
var crypto = require('crypto');
|
||||
|
||||
function sha1(bytes) {
|
||||
// support modern Buffer API
|
||||
if (typeof Buffer.from === 'function') {
|
||||
if (Array.isArray(bytes)) bytes = Buffer.from(bytes);
|
||||
else if (typeof bytes === 'string') bytes = Buffer.from(bytes, 'utf8');
|
||||
}
|
||||
|
||||
// support pre-v4 Buffer API
|
||||
else {
|
||||
if (Array.isArray(bytes)) bytes = new Buffer(bytes);
|
||||
else if (typeof bytes === 'string') bytes = new Buffer(bytes, 'utf8');
|
||||
}
|
||||
|
||||
return crypto.createHash('sha1').update(bytes).digest();
|
||||
}
|
||||
|
||||
module.exports = sha1;
|
||||
84
build/node_modules/uuid/package.json
generated
vendored
Normal file
84
build/node_modules/uuid/package.json
generated
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"uuid@3.1.0",
|
||||
"/Users/asciidisco/Desktop/asciidisco.com/build"
|
||||
]
|
||||
],
|
||||
"_from": "uuid@3.1.0",
|
||||
"_id": "uuid@3.1.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==",
|
||||
"_location": "/uuid",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "uuid@3.1.0",
|
||||
"name": "uuid",
|
||||
"escapedName": "uuid",
|
||||
"rawSpec": "3.1.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "3.1.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/node-pre-gyp/request",
|
||||
"/request",
|
||||
"/tempfile"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz",
|
||||
"_spec": "3.1.0",
|
||||
"_where": "/Users/asciidisco/Desktop/asciidisco.com/build",
|
||||
"bin": {
|
||||
"uuid": "./bin/uuid"
|
||||
},
|
||||
"browser": {
|
||||
"./lib/rng.js": "./lib/rng-browser.js",
|
||||
"./lib/sha1.js": "./lib/sha1-browser.js"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/kelektiv/node-uuid/issues"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Robert Kieffer",
|
||||
"email": "robert@broofa.com"
|
||||
},
|
||||
{
|
||||
"name": "Christoph Tavan",
|
||||
"email": "dev@tavan.de"
|
||||
},
|
||||
{
|
||||
"name": "AJ ONeal",
|
||||
"email": "coolaj86@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Vincent Voyer",
|
||||
"email": "vincent@zeroload.net"
|
||||
},
|
||||
{
|
||||
"name": "Roman Shtylman",
|
||||
"email": "shtylman@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "RFC4122 (v1, v4, and v5) UUIDs",
|
||||
"devDependencies": {
|
||||
"mocha": "3.1.2"
|
||||
},
|
||||
"homepage": "https://github.com/kelektiv/node-uuid#readme",
|
||||
"keywords": [
|
||||
"uuid",
|
||||
"guid",
|
||||
"rfc4122"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "uuid",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/kelektiv/node-uuid.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha test/test.js"
|
||||
},
|
||||
"version": "3.1.0"
|
||||
}
|
||||
100
build/node_modules/uuid/v1.js
generated
vendored
Normal file
100
build/node_modules/uuid/v1.js
generated
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
var rng = require('./lib/rng');
|
||||
var bytesToUuid = require('./lib/bytesToUuid');
|
||||
|
||||
// **`v1()` - Generate time-based UUID**
|
||||
//
|
||||
// Inspired by https://github.com/LiosK/UUID.js
|
||||
// and http://docs.python.org/library/uuid.html
|
||||
|
||||
// random #'s we need to init node and clockseq
|
||||
var _seedBytes = rng();
|
||||
|
||||
// Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
|
||||
var _nodeId = [
|
||||
_seedBytes[0] | 0x01,
|
||||
_seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5]
|
||||
];
|
||||
|
||||
// Per 4.2.2, randomize (14 bit) clockseq
|
||||
var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff;
|
||||
|
||||
// Previous uuid creation time
|
||||
var _lastMSecs = 0, _lastNSecs = 0;
|
||||
|
||||
// See https://github.com/broofa/node-uuid for API details
|
||||
function v1(options, buf, offset) {
|
||||
var i = buf && offset || 0;
|
||||
var b = buf || [];
|
||||
|
||||
options = options || {};
|
||||
|
||||
var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;
|
||||
|
||||
// UUID timestamps are 100 nano-second units since the Gregorian epoch,
|
||||
// (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
|
||||
// time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
|
||||
// (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
|
||||
var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();
|
||||
|
||||
// Per 4.2.1.2, use count of uuid's generated during the current clock
|
||||
// cycle to simulate higher resolution clock
|
||||
var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;
|
||||
|
||||
// Time since last uuid creation (in msecs)
|
||||
var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;
|
||||
|
||||
// Per 4.2.1.2, Bump clockseq on clock regression
|
||||
if (dt < 0 && options.clockseq === undefined) {
|
||||
clockseq = clockseq + 1 & 0x3fff;
|
||||
}
|
||||
|
||||
// Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
|
||||
// time interval
|
||||
if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
|
||||
nsecs = 0;
|
||||
}
|
||||
|
||||
// Per 4.2.1.2 Throw error if too many uuids are requested
|
||||
if (nsecs >= 10000) {
|
||||
throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
|
||||
}
|
||||
|
||||
_lastMSecs = msecs;
|
||||
_lastNSecs = nsecs;
|
||||
_clockseq = clockseq;
|
||||
|
||||
// Per 4.1.4 - Convert from unix epoch to Gregorian epoch
|
||||
msecs += 12219292800000;
|
||||
|
||||
// `time_low`
|
||||
var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
|
||||
b[i++] = tl >>> 24 & 0xff;
|
||||
b[i++] = tl >>> 16 & 0xff;
|
||||
b[i++] = tl >>> 8 & 0xff;
|
||||
b[i++] = tl & 0xff;
|
||||
|
||||
// `time_mid`
|
||||
var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;
|
||||
b[i++] = tmh >>> 8 & 0xff;
|
||||
b[i++] = tmh & 0xff;
|
||||
|
||||
// `time_high_and_version`
|
||||
b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
|
||||
b[i++] = tmh >>> 16 & 0xff;
|
||||
|
||||
// `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
|
||||
b[i++] = clockseq >>> 8 | 0x80;
|
||||
|
||||
// `clock_seq_low`
|
||||
b[i++] = clockseq & 0xff;
|
||||
|
||||
// `node`
|
||||
var node = options.node || _nodeId;
|
||||
for (var n = 0; n < 6; ++n) {
|
||||
b[i + n] = node[n];
|
||||
}
|
||||
|
||||
return buf ? buf : bytesToUuid(b);
|
||||
}
|
||||
|
||||
module.exports = v1;
|
||||
29
build/node_modules/uuid/v4.js
generated
vendored
Normal file
29
build/node_modules/uuid/v4.js
generated
vendored
Normal file
@@ -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;
|
||||
42
build/node_modules/uuid/v5.js
generated
vendored
Normal file
42
build/node_modules/uuid/v5.js
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
var sha1 = require('./lib/sha1-browser');
|
||||
var bytesToUuid = require('./lib/bytesToUuid');
|
||||
|
||||
function uuidToBytes(uuid) {
|
||||
// Note: We assume we're being passed a valid uuid string
|
||||
var bytes = [];
|
||||
uuid.replace(/[a-fA-F0-9]{2}/g, function(hex) {
|
||||
bytes.push(parseInt(hex, 16));
|
||||
});
|
||||
|
||||
return bytes;
|
||||
}
|
||||
|
||||
function stringToBytes(str) {
|
||||
str = unescape(encodeURIComponent(str)); // UTF8 escape
|
||||
var bytes = new Array(str.length);
|
||||
for (var i = 0; i < str.length; i++) {
|
||||
bytes[i] = str.charCodeAt(i);
|
||||
}
|
||||
return bytes;
|
||||
}
|
||||
|
||||
function v5(name, namespace, buf, offset) {
|
||||
if (typeof(name) == 'string') name = stringToBytes(name);
|
||||
if (typeof(namespace) == 'string') namespace = uuidToBytes(namespace);
|
||||
|
||||
if (!Array.isArray(name)) throw TypeError('name must be an array of bytes');
|
||||
if (!Array.isArray(namespace) || namespace.length != 16) throw TypeError('namespace must be uuid string or an Array of 16 byte values');
|
||||
|
||||
// Per 4.3
|
||||
var bytes = sha1(namespace.concat(name));
|
||||
bytes[6] = (bytes[6] & 0x0f) | 0x50;
|
||||
bytes[8] = (bytes[8] & 0x3f) | 0x80;
|
||||
|
||||
return buf || bytesToUuid(bytes);
|
||||
}
|
||||
|
||||
// Pre-defined namespaces, per Appendix C
|
||||
v5.DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
|
||||
v5.URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
|
||||
|
||||
module.exports = v5;
|
||||
Reference in New Issue
Block a user