node-red-contrib-web-worldmap 2.23.5 → 2.24.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -1
- package/README.md +11 -2
- package/node_modules/body-parser/HISTORY.md +15 -0
- package/node_modules/body-parser/README.md +25 -12
- package/node_modules/body-parser/node_modules/bytes/History.md +5 -0
- package/node_modules/body-parser/node_modules/bytes/Readme.md +42 -16
- package/node_modules/body-parser/node_modules/bytes/index.js +5 -1
- package/node_modules/body-parser/node_modules/bytes/package.json +20 -22
- package/node_modules/body-parser/package.json +34 -37
- package/node_modules/content-disposition/HISTORY.md +5 -0
- package/node_modules/content-disposition/README.md +3 -9
- package/node_modules/content-disposition/index.js +1 -1
- package/node_modules/content-disposition/node_modules/safe-buffer/LICENSE +21 -0
- package/node_modules/content-disposition/node_modules/safe-buffer/README.md +584 -0
- package/node_modules/content-disposition/node_modules/safe-buffer/index.d.ts +187 -0
- package/node_modules/content-disposition/node_modules/safe-buffer/index.js +65 -0
- package/node_modules/content-disposition/node_modules/safe-buffer/package.json +76 -0
- package/node_modules/content-disposition/package.json +27 -30
- package/node_modules/cookie/HISTORY.md +5 -0
- package/node_modules/cookie/README.md +4 -0
- package/node_modules/cookie/index.js +5 -1
- package/node_modules/cookie/package.json +22 -25
- package/node_modules/express/History.md +33 -0
- package/node_modules/express/Readme.md +8 -5
- package/node_modules/express/lib/application.js +1 -1
- package/node_modules/express/lib/request.js +1 -1
- package/node_modules/express/lib/response.js +16 -11
- package/node_modules/express/lib/router/index.js +6 -0
- package/node_modules/express/lib/utils.js +2 -6
- package/node_modules/express/node_modules/safe-buffer/LICENSE +21 -0
- package/node_modules/express/node_modules/safe-buffer/README.md +584 -0
- package/node_modules/express/node_modules/safe-buffer/index.d.ts +187 -0
- package/node_modules/express/node_modules/safe-buffer/index.js +65 -0
- package/node_modules/express/node_modules/safe-buffer/package.json +76 -0
- package/node_modules/express/package.json +37 -39
- package/node_modules/faye-websocket/CHANGELOG.md +5 -0
- package/node_modules/faye-websocket/LICENSE.md +1 -1
- package/node_modules/faye-websocket/README.md +13 -13
- package/node_modules/faye-websocket/lib/faye/websocket/api.js +10 -8
- package/node_modules/faye-websocket/lib/faye/websocket/client.js +4 -4
- package/node_modules/faye-websocket/lib/faye/websocket.js +1 -1
- package/node_modules/faye-websocket/package.json +16 -19
- package/node_modules/forwarded/HISTORY.md +5 -0
- package/node_modules/forwarded/README.md +3 -3
- package/node_modules/forwarded/index.js +15 -1
- package/node_modules/forwarded/package.json +27 -28
- package/node_modules/http-errors/HISTORY.md +16 -0
- package/node_modules/http-errors/README.md +12 -6
- package/node_modules/http-errors/index.js +35 -2
- package/node_modules/http-errors/package.json +32 -35
- package/node_modules/inherits/inherits.js +2 -0
- package/node_modules/inherits/inherits_browser.js +18 -14
- package/node_modules/inherits/package.json +17 -20
- package/node_modules/ipaddr.js/README.md +1 -1
- package/node_modules/ipaddr.js/lib/ipaddr.js.d.ts +6 -9
- package/node_modules/ipaddr.js/package.json +17 -19
- package/node_modules/proxy-addr/HISTORY.md +11 -0
- package/node_modules/proxy-addr/README.md +3 -19
- package/node_modules/proxy-addr/index.js +1 -1
- package/node_modules/proxy-addr/package.json +30 -33
- package/node_modules/qs/.editorconfig +9 -0
- package/node_modules/qs/.eslintignore +2 -1
- package/node_modules/qs/.eslintrc +15 -1
- package/node_modules/qs/.github/FUNDING.yml +12 -0
- package/node_modules/qs/.nycrc +13 -0
- package/node_modules/qs/CHANGELOG.md +103 -0
- package/node_modules/qs/LICENSE.md +29 -0
- package/node_modules/qs/README.md +34 -0
- package/node_modules/qs/dist/qs.js +117 -67
- package/node_modules/qs/lib/formats.js +9 -4
- package/node_modules/qs/lib/parse.js +29 -14
- package/node_modules/qs/lib/stringify.js +55 -46
- package/node_modules/qs/lib/utils.js +23 -2
- package/node_modules/qs/package.json +42 -34
- package/node_modules/qs/test/parse.js +97 -1
- package/node_modules/qs/test/stringify.js +115 -1
- package/node_modules/qs/test/utils.js +1 -1
- package/node_modules/raw-body/HISTORY.md +14 -0
- package/node_modules/raw-body/README.md +3 -5
- package/node_modules/raw-body/node_modules/bytes/History.md +5 -0
- package/node_modules/raw-body/node_modules/bytes/Readme.md +42 -16
- package/node_modules/raw-body/node_modules/bytes/index.js +5 -1
- package/node_modules/raw-body/node_modules/bytes/package.json +20 -22
- package/node_modules/raw-body/package.json +32 -35
- package/node_modules/send/HISTORY.md +10 -0
- package/node_modules/send/README.md +4 -6
- package/node_modules/send/index.js +7 -3
- package/node_modules/send/node_modules/ms/index.js +3 -3
- package/node_modules/send/node_modules/ms/license.md +1 -1
- package/node_modules/send/node_modules/ms/package.json +21 -23
- package/node_modules/send/node_modules/ms/readme.md +1 -2
- package/node_modules/send/package.json +31 -34
- package/node_modules/serve-static/HISTORY.md +8 -0
- package/node_modules/serve-static/README.md +9 -11
- package/node_modules/serve-static/package.json +30 -33
- package/node_modules/setprototypeof/README.md +1 -1
- package/node_modules/setprototypeof/index.js +1 -1
- package/node_modules/setprototypeof/package.json +20 -21
- package/node_modules/sockjs/Changelog +12 -0
- package/node_modules/sockjs/lib/transport.js +1 -1
- package/node_modules/sockjs/package.json +16 -19
- package/node_modules/toidentifier/HISTORY.md +9 -0
- package/node_modules/toidentifier/README.md +3 -3
- package/node_modules/toidentifier/index.js +2 -0
- package/node_modules/toidentifier/package.json +30 -29
- package/node_modules/uuid/CHANGELOG.md +154 -44
- package/node_modules/uuid/CONTRIBUTING.md +18 -0
- package/node_modules/uuid/LICENSE.md +4 -16
- package/node_modules/uuid/README.md +384 -155
- package/node_modules/uuid/dist/bin/uuid +2 -0
- package/node_modules/uuid/dist/esm-browser/index.js +9 -0
- package/node_modules/uuid/{lib/md5-browser.js → dist/esm-browser/md5.js} +70 -71
- package/node_modules/uuid/dist/esm-browser/nil.js +1 -0
- package/node_modules/uuid/dist/esm-browser/parse.js +35 -0
- package/node_modules/uuid/dist/esm-browser/regex.js +1 -0
- package/node_modules/uuid/dist/esm-browser/rng.js +19 -0
- package/node_modules/uuid/dist/esm-browser/sha1.js +96 -0
- package/node_modules/uuid/dist/esm-browser/stringify.js +30 -0
- package/node_modules/uuid/{v1.js → dist/esm-browser/v1.js} +36 -50
- package/node_modules/uuid/dist/esm-browser/v3.js +4 -0
- package/node_modules/uuid/dist/esm-browser/v35.js +64 -0
- package/node_modules/uuid/dist/esm-browser/v4.js +24 -0
- package/node_modules/uuid/dist/esm-browser/v5.js +4 -0
- package/node_modules/uuid/dist/esm-browser/validate.js +7 -0
- package/node_modules/uuid/dist/esm-browser/version.js +11 -0
- package/node_modules/uuid/dist/esm-node/index.js +9 -0
- package/node_modules/uuid/dist/esm-node/md5.js +13 -0
- package/node_modules/uuid/dist/esm-node/nil.js +1 -0
- package/node_modules/uuid/dist/esm-node/parse.js +35 -0
- package/node_modules/uuid/dist/esm-node/regex.js +1 -0
- package/node_modules/uuid/dist/esm-node/rng.js +12 -0
- package/node_modules/uuid/dist/esm-node/sha1.js +13 -0
- package/node_modules/uuid/dist/esm-node/stringify.js +29 -0
- package/node_modules/uuid/dist/esm-node/v1.js +95 -0
- package/node_modules/uuid/dist/esm-node/v3.js +4 -0
- package/node_modules/uuid/dist/esm-node/v35.js +64 -0
- package/node_modules/uuid/dist/esm-node/v4.js +24 -0
- package/node_modules/uuid/dist/esm-node/v5.js +4 -0
- package/node_modules/uuid/dist/esm-node/validate.js +7 -0
- package/node_modules/uuid/dist/esm-node/version.js +11 -0
- package/node_modules/uuid/dist/index.js +79 -0
- package/node_modules/uuid/dist/md5-browser.js +223 -0
- package/node_modules/uuid/dist/md5.js +23 -0
- package/node_modules/uuid/dist/nil.js +8 -0
- package/node_modules/uuid/dist/parse.js +45 -0
- package/node_modules/uuid/dist/regex.js +8 -0
- package/node_modules/uuid/dist/rng-browser.js +26 -0
- package/node_modules/uuid/dist/rng.js +24 -0
- package/node_modules/uuid/dist/sha1-browser.js +104 -0
- package/node_modules/uuid/dist/sha1.js +23 -0
- package/node_modules/uuid/dist/stringify.js +39 -0
- package/node_modules/uuid/dist/umd/uuid.min.js +1 -0
- package/node_modules/uuid/dist/umd/uuidNIL.min.js +1 -0
- package/node_modules/uuid/dist/umd/uuidParse.min.js +1 -0
- package/node_modules/uuid/dist/umd/uuidStringify.min.js +1 -0
- package/node_modules/uuid/dist/umd/uuidValidate.min.js +1 -0
- package/node_modules/uuid/dist/umd/uuidVersion.min.js +1 -0
- package/node_modules/uuid/dist/umd/uuidv1.min.js +1 -0
- package/node_modules/uuid/dist/umd/uuidv3.min.js +1 -0
- package/node_modules/uuid/dist/umd/uuidv4.min.js +1 -0
- package/node_modules/uuid/dist/umd/uuidv5.min.js +1 -0
- package/node_modules/uuid/dist/uuid-bin.js +85 -0
- package/node_modules/uuid/dist/v1.js +107 -0
- package/node_modules/uuid/dist/v3.js +16 -0
- package/node_modules/uuid/dist/v35.js +78 -0
- package/node_modules/uuid/dist/v4.js +37 -0
- package/node_modules/uuid/dist/v5.js +16 -0
- package/node_modules/uuid/dist/validate.js +17 -0
- package/node_modules/uuid/dist/version.js +21 -0
- package/node_modules/uuid/package.json +118 -57
- package/node_modules/uuid/wrapper.mjs +10 -0
- package/node_modules/websocket-driver/node_modules/http-parser-js/package.json +4 -4
- package/package.json +3 -3
- package/worldmap/css/worldmap.css +7 -5
- package/worldmap/index.html +1 -0
- package/worldmap/leaflet/leaflet-arc.min.js +1 -0
- package/worldmap/worldmap.js +44 -27
- package/worldmap.html +1 -1
- package/worldmap.js +2 -2
- package/node_modules/qs/LICENSE +0 -28
- package/node_modules/qs/test/.eslintrc +0 -17
- package/node_modules/qs/test/index.js +0 -7
- package/node_modules/uuid/AUTHORS +0 -5
- package/node_modules/uuid/bin/uuid +0 -65
- package/node_modules/uuid/index.js +0 -8
- package/node_modules/uuid/lib/bytesToUuid.js +0 -26
- package/node_modules/uuid/lib/md5.js +0 -25
- package/node_modules/uuid/lib/rng-browser.js +0 -34
- package/node_modules/uuid/lib/rng.js +0 -8
- package/node_modules/uuid/lib/sha1-browser.js +0 -89
- package/node_modules/uuid/lib/sha1.js +0 -25
- package/node_modules/uuid/lib/v35.js +0 -57
- package/node_modules/uuid/v3.js +0 -4
- package/node_modules/uuid/v4.js +0 -29
- package/node_modules/uuid/v5.js +0 -3
package/node_modules/qs/LICENSE
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
Copyright (c) 2014 Nathan LaFreniere and other contributors.
|
|
2
|
-
All rights reserved.
|
|
3
|
-
|
|
4
|
-
Redistribution and use in source and binary forms, with or without
|
|
5
|
-
modification, are permitted provided that the following conditions are met:
|
|
6
|
-
* Redistributions of source code must retain the above copyright
|
|
7
|
-
notice, this list of conditions and the following disclaimer.
|
|
8
|
-
* Redistributions in binary form must reproduce the above copyright
|
|
9
|
-
notice, this list of conditions and the following disclaimer in the
|
|
10
|
-
documentation and/or other materials provided with the distribution.
|
|
11
|
-
* The names of any contributors may not be used to endorse or promote
|
|
12
|
-
products derived from this software without specific prior written
|
|
13
|
-
permission.
|
|
14
|
-
|
|
15
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
16
|
-
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
17
|
-
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
18
|
-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY
|
|
19
|
-
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
20
|
-
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
21
|
-
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
22
|
-
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
23
|
-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
24
|
-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
25
|
-
|
|
26
|
-
* * *
|
|
27
|
-
|
|
28
|
-
The complete list of contributors can be found at: https://github.com/hapijs/qs/graphs/contributors
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"rules": {
|
|
3
|
-
"array-bracket-newline": 0,
|
|
4
|
-
"array-element-newline": 0,
|
|
5
|
-
"consistent-return": 2,
|
|
6
|
-
"function-paren-newline": 0,
|
|
7
|
-
"max-lines": 0,
|
|
8
|
-
"max-lines-per-function": 0,
|
|
9
|
-
"max-nested-callbacks": [2, 3],
|
|
10
|
-
"max-statements": 0,
|
|
11
|
-
"no-buffer-constructor": 0,
|
|
12
|
-
"no-extend-native": 0,
|
|
13
|
-
"no-magic-numbers": 0,
|
|
14
|
-
"object-curly-newline": 0,
|
|
15
|
-
"sort-keys": 0
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
var assert = require('assert');
|
|
3
|
-
|
|
4
|
-
function usage() {
|
|
5
|
-
console.log('Usage:');
|
|
6
|
-
console.log(' uuid');
|
|
7
|
-
console.log(' uuid v1');
|
|
8
|
-
console.log(' uuid v3 <name> <namespace uuid>');
|
|
9
|
-
console.log(' uuid v4');
|
|
10
|
-
console.log(' uuid v5 <name> <namespace uuid>');
|
|
11
|
-
console.log(' uuid --help');
|
|
12
|
-
console.log('\nNote: <namespace uuid> may be "URL" or "DNS" to use the corresponding UUIDs defined by RFC4122');
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
var args = process.argv.slice(2);
|
|
16
|
-
|
|
17
|
-
if (args.indexOf('--help') >= 0) {
|
|
18
|
-
usage();
|
|
19
|
-
process.exit(0);
|
|
20
|
-
}
|
|
21
|
-
var version = args.shift() || 'v4';
|
|
22
|
-
|
|
23
|
-
switch (version) {
|
|
24
|
-
case 'v1':
|
|
25
|
-
var uuidV1 = require('../v1');
|
|
26
|
-
console.log(uuidV1());
|
|
27
|
-
break;
|
|
28
|
-
|
|
29
|
-
case 'v3':
|
|
30
|
-
var uuidV3 = require('../v3');
|
|
31
|
-
|
|
32
|
-
var name = args.shift();
|
|
33
|
-
var namespace = args.shift();
|
|
34
|
-
assert(name != null, 'v3 name not specified');
|
|
35
|
-
assert(namespace != null, 'v3 namespace not specified');
|
|
36
|
-
|
|
37
|
-
if (namespace == 'URL') namespace = uuidV3.URL;
|
|
38
|
-
if (namespace == 'DNS') namespace = uuidV3.DNS;
|
|
39
|
-
|
|
40
|
-
console.log(uuidV3(name, namespace));
|
|
41
|
-
break;
|
|
42
|
-
|
|
43
|
-
case 'v4':
|
|
44
|
-
var uuidV4 = require('../v4');
|
|
45
|
-
console.log(uuidV4());
|
|
46
|
-
break;
|
|
47
|
-
|
|
48
|
-
case 'v5':
|
|
49
|
-
var uuidV5 = require('../v5');
|
|
50
|
-
|
|
51
|
-
var name = args.shift();
|
|
52
|
-
var namespace = args.shift();
|
|
53
|
-
assert(name != null, 'v5 name not specified');
|
|
54
|
-
assert(namespace != null, 'v5 namespace not specified');
|
|
55
|
-
|
|
56
|
-
if (namespace == 'URL') namespace = uuidV5.URL;
|
|
57
|
-
if (namespace == 'DNS') namespace = uuidV5.DNS;
|
|
58
|
-
|
|
59
|
-
console.log(uuidV5(name, namespace));
|
|
60
|
-
break;
|
|
61
|
-
|
|
62
|
-
default:
|
|
63
|
-
usage();
|
|
64
|
-
process.exit(1);
|
|
65
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Convert array of 16 byte values to UUID string format of the form:
|
|
3
|
-
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
4
|
-
*/
|
|
5
|
-
var byteToHex = [];
|
|
6
|
-
for (var i = 0; i < 256; ++i) {
|
|
7
|
-
byteToHex[i] = (i + 0x100).toString(16).substr(1);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function bytesToUuid(buf, offset) {
|
|
11
|
-
var i = offset || 0;
|
|
12
|
-
var bth = byteToHex;
|
|
13
|
-
// join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
|
|
14
|
-
return ([
|
|
15
|
-
bth[buf[i++]], bth[buf[i++]],
|
|
16
|
-
bth[buf[i++]], bth[buf[i++]], '-',
|
|
17
|
-
bth[buf[i++]], bth[buf[i++]], '-',
|
|
18
|
-
bth[buf[i++]], bth[buf[i++]], '-',
|
|
19
|
-
bth[buf[i++]], bth[buf[i++]], '-',
|
|
20
|
-
bth[buf[i++]], bth[buf[i++]],
|
|
21
|
-
bth[buf[i++]], bth[buf[i++]],
|
|
22
|
-
bth[buf[i++]], bth[buf[i++]]
|
|
23
|
-
]).join('');
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
module.exports = bytesToUuid;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var crypto = require('crypto');
|
|
4
|
-
|
|
5
|
-
function md5(bytes) {
|
|
6
|
-
if (typeof Buffer.from === 'function') {
|
|
7
|
-
// Modern Buffer API
|
|
8
|
-
if (Array.isArray(bytes)) {
|
|
9
|
-
bytes = Buffer.from(bytes);
|
|
10
|
-
} else if (typeof bytes === 'string') {
|
|
11
|
-
bytes = Buffer.from(bytes, 'utf8');
|
|
12
|
-
}
|
|
13
|
-
} else {
|
|
14
|
-
// Pre-v4 Buffer API
|
|
15
|
-
if (Array.isArray(bytes)) {
|
|
16
|
-
bytes = new Buffer(bytes);
|
|
17
|
-
} else if (typeof bytes === 'string') {
|
|
18
|
-
bytes = new Buffer(bytes, 'utf8');
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return crypto.createHash('md5').update(bytes).digest();
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
module.exports = md5;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// Unique ID creation requires a high quality random # generator. In the
|
|
2
|
-
// browser this is a little complicated due to unknown quality of Math.random()
|
|
3
|
-
// and inconsistent support for the `crypto` API. We do the best we can via
|
|
4
|
-
// feature-detection
|
|
5
|
-
|
|
6
|
-
// getRandomValues needs to be invoked in a context where "this" is a Crypto
|
|
7
|
-
// implementation. Also, find the complete implementation of crypto on IE11.
|
|
8
|
-
var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||
|
|
9
|
-
(typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));
|
|
10
|
-
|
|
11
|
-
if (getRandomValues) {
|
|
12
|
-
// WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
|
|
13
|
-
var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
|
|
14
|
-
|
|
15
|
-
module.exports = function whatwgRNG() {
|
|
16
|
-
getRandomValues(rnds8);
|
|
17
|
-
return rnds8;
|
|
18
|
-
};
|
|
19
|
-
} else {
|
|
20
|
-
// Math.random()-based (RNG)
|
|
21
|
-
//
|
|
22
|
-
// If all else fails, use Math.random(). It's fast, but is of unspecified
|
|
23
|
-
// quality.
|
|
24
|
-
var rnds = new Array(16);
|
|
25
|
-
|
|
26
|
-
module.exports = function mathRNG() {
|
|
27
|
-
for (var i = 0, r; i < 16; i++) {
|
|
28
|
-
if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
|
|
29
|
-
rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return rnds;
|
|
33
|
-
};
|
|
34
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
// Adapted from Chris Veness' SHA1 code at
|
|
2
|
-
// http://www.movable-type.co.uk/scripts/sha1.html
|
|
3
|
-
'use strict';
|
|
4
|
-
|
|
5
|
-
function f(s, x, y, z) {
|
|
6
|
-
switch (s) {
|
|
7
|
-
case 0: return (x & y) ^ (~x & z);
|
|
8
|
-
case 1: return x ^ y ^ z;
|
|
9
|
-
case 2: return (x & y) ^ (x & z) ^ (y & z);
|
|
10
|
-
case 3: return x ^ y ^ z;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function ROTL(x, n) {
|
|
15
|
-
return (x << n) | (x>>> (32 - n));
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function sha1(bytes) {
|
|
19
|
-
var K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];
|
|
20
|
-
var H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];
|
|
21
|
-
|
|
22
|
-
if (typeof(bytes) == 'string') {
|
|
23
|
-
var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape
|
|
24
|
-
bytes = new Array(msg.length);
|
|
25
|
-
for (var i = 0; i < msg.length; i++) bytes[i] = msg.charCodeAt(i);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
bytes.push(0x80);
|
|
29
|
-
|
|
30
|
-
var l = bytes.length/4 + 2;
|
|
31
|
-
var N = Math.ceil(l/16);
|
|
32
|
-
var M = new Array(N);
|
|
33
|
-
|
|
34
|
-
for (var i=0; i<N; i++) {
|
|
35
|
-
M[i] = new Array(16);
|
|
36
|
-
for (var j=0; j<16; j++) {
|
|
37
|
-
M[i][j] =
|
|
38
|
-
bytes[i * 64 + j * 4] << 24 |
|
|
39
|
-
bytes[i * 64 + j * 4 + 1] << 16 |
|
|
40
|
-
bytes[i * 64 + j * 4 + 2] << 8 |
|
|
41
|
-
bytes[i * 64 + j * 4 + 3];
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
M[N - 1][14] = ((bytes.length - 1) * 8) /
|
|
46
|
-
Math.pow(2, 32); M[N - 1][14] = Math.floor(M[N - 1][14]);
|
|
47
|
-
M[N - 1][15] = ((bytes.length - 1) * 8) & 0xffffffff;
|
|
48
|
-
|
|
49
|
-
for (var i=0; i<N; i++) {
|
|
50
|
-
var W = new Array(80);
|
|
51
|
-
|
|
52
|
-
for (var t=0; t<16; t++) W[t] = M[i][t];
|
|
53
|
-
for (var t=16; t<80; t++) {
|
|
54
|
-
W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
var a = H[0];
|
|
58
|
-
var b = H[1];
|
|
59
|
-
var c = H[2];
|
|
60
|
-
var d = H[3];
|
|
61
|
-
var e = H[4];
|
|
62
|
-
|
|
63
|
-
for (var t=0; t<80; t++) {
|
|
64
|
-
var s = Math.floor(t/20);
|
|
65
|
-
var T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t] >>> 0;
|
|
66
|
-
e = d;
|
|
67
|
-
d = c;
|
|
68
|
-
c = ROTL(b, 30) >>> 0;
|
|
69
|
-
b = a;
|
|
70
|
-
a = T;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
H[0] = (H[0] + a) >>> 0;
|
|
74
|
-
H[1] = (H[1] + b) >>> 0;
|
|
75
|
-
H[2] = (H[2] + c) >>> 0;
|
|
76
|
-
H[3] = (H[3] + d) >>> 0;
|
|
77
|
-
H[4] = (H[4] + e) >>> 0;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
return [
|
|
81
|
-
H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff,
|
|
82
|
-
H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff,
|
|
83
|
-
H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff,
|
|
84
|
-
H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff,
|
|
85
|
-
H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff
|
|
86
|
-
];
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
module.exports = sha1;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var crypto = require('crypto');
|
|
4
|
-
|
|
5
|
-
function sha1(bytes) {
|
|
6
|
-
if (typeof Buffer.from === 'function') {
|
|
7
|
-
// Modern Buffer API
|
|
8
|
-
if (Array.isArray(bytes)) {
|
|
9
|
-
bytes = Buffer.from(bytes);
|
|
10
|
-
} else if (typeof bytes === 'string') {
|
|
11
|
-
bytes = Buffer.from(bytes, 'utf8');
|
|
12
|
-
}
|
|
13
|
-
} else {
|
|
14
|
-
// Pre-v4 Buffer API
|
|
15
|
-
if (Array.isArray(bytes)) {
|
|
16
|
-
bytes = new Buffer(bytes);
|
|
17
|
-
} else if (typeof bytes === 'string') {
|
|
18
|
-
bytes = new Buffer(bytes, 'utf8');
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return crypto.createHash('sha1').update(bytes).digest();
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
module.exports = sha1;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
var bytesToUuid = require('./bytesToUuid');
|
|
2
|
-
|
|
3
|
-
function uuidToBytes(uuid) {
|
|
4
|
-
// Note: We assume we're being passed a valid uuid string
|
|
5
|
-
var bytes = [];
|
|
6
|
-
uuid.replace(/[a-fA-F0-9]{2}/g, function(hex) {
|
|
7
|
-
bytes.push(parseInt(hex, 16));
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
return bytes;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function stringToBytes(str) {
|
|
14
|
-
str = unescape(encodeURIComponent(str)); // UTF8 escape
|
|
15
|
-
var bytes = new Array(str.length);
|
|
16
|
-
for (var i = 0; i < str.length; i++) {
|
|
17
|
-
bytes[i] = str.charCodeAt(i);
|
|
18
|
-
}
|
|
19
|
-
return bytes;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
module.exports = function(name, version, hashfunc) {
|
|
23
|
-
var generateUUID = function(value, namespace, buf, offset) {
|
|
24
|
-
var off = buf && offset || 0;
|
|
25
|
-
|
|
26
|
-
if (typeof(value) == 'string') value = stringToBytes(value);
|
|
27
|
-
if (typeof(namespace) == 'string') namespace = uuidToBytes(namespace);
|
|
28
|
-
|
|
29
|
-
if (!Array.isArray(value)) throw TypeError('value must be an array of bytes');
|
|
30
|
-
if (!Array.isArray(namespace) || namespace.length !== 16) throw TypeError('namespace must be uuid string or an Array of 16 byte values');
|
|
31
|
-
|
|
32
|
-
// Per 4.3
|
|
33
|
-
var bytes = hashfunc(namespace.concat(value));
|
|
34
|
-
bytes[6] = (bytes[6] & 0x0f) | version;
|
|
35
|
-
bytes[8] = (bytes[8] & 0x3f) | 0x80;
|
|
36
|
-
|
|
37
|
-
if (buf) {
|
|
38
|
-
for (var idx = 0; idx < 16; ++idx) {
|
|
39
|
-
buf[off+idx] = bytes[idx];
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return buf || bytesToUuid(bytes);
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
// Function#name is not settable on some platforms (#270)
|
|
47
|
-
try {
|
|
48
|
-
generateUUID.name = name;
|
|
49
|
-
} catch (err) {
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// Pre-defined namespaces, per Appendix C
|
|
53
|
-
generateUUID.DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
|
|
54
|
-
generateUUID.URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
|
|
55
|
-
|
|
56
|
-
return generateUUID;
|
|
57
|
-
};
|
package/node_modules/uuid/v3.js
DELETED
package/node_modules/uuid/v4.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
var rng = require('./lib/rng');
|
|
2
|
-
var bytesToUuid = require('./lib/bytesToUuid');
|
|
3
|
-
|
|
4
|
-
function v4(options, buf, offset) {
|
|
5
|
-
var i = buf && offset || 0;
|
|
6
|
-
|
|
7
|
-
if (typeof(options) == 'string') {
|
|
8
|
-
buf = options === 'binary' ? new Array(16) : null;
|
|
9
|
-
options = null;
|
|
10
|
-
}
|
|
11
|
-
options = options || {};
|
|
12
|
-
|
|
13
|
-
var rnds = options.random || (options.rng || rng)();
|
|
14
|
-
|
|
15
|
-
// Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
16
|
-
rnds[6] = (rnds[6] & 0x0f) | 0x40;
|
|
17
|
-
rnds[8] = (rnds[8] & 0x3f) | 0x80;
|
|
18
|
-
|
|
19
|
-
// Copy bytes to buffer, if provided
|
|
20
|
-
if (buf) {
|
|
21
|
-
for (var ii = 0; ii < 16; ++ii) {
|
|
22
|
-
buf[i + ii] = rnds[ii];
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return buf || bytesToUuid(rnds);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
module.exports = v4;
|
package/node_modules/uuid/v5.js
DELETED