@nocobase/plugin-async-task-manager 1.7.0-beta.2 → 1.7.0-beta.21
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/LICENSE.txt +4 -4
- package/dist/client/AsyncTaskManagerProvider.d.ts +8 -2
- package/dist/client/components/AsyncTasks.d.ts +8 -0
- package/dist/client/index.js +1 -1
- package/dist/externalVersion.js +6 -6
- package/dist/locale/it-IT.json +2 -2
- package/dist/locale/nl-NL.json +45 -4
- package/dist/node_modules/uuid/dist/bin/uuid +2 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/index.js +79 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/md5.js +223 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/native.js +11 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/nil.js +8 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/parse.js +45 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/regex.js +8 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/rng.js +25 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/sha1.js +104 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/stringify.js +44 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/v1.js +107 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/v3.js +16 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/v35.js +80 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/v4.js +43 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/v5.js +16 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/validate.js +17 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/version.js +21 -0
- package/dist/node_modules/uuid/dist/esm-browser/index.js +9 -0
- package/dist/node_modules/uuid/{lib/md5-browser.js → dist/esm-browser/md5.js} +80 -81
- package/dist/node_modules/uuid/dist/esm-browser/native.js +4 -0
- package/dist/node_modules/uuid/dist/esm-browser/nil.js +1 -0
- package/dist/node_modules/uuid/dist/esm-browser/parse.js +35 -0
- package/dist/node_modules/uuid/dist/esm-browser/regex.js +1 -0
- package/dist/node_modules/uuid/dist/esm-browser/rng.js +18 -0
- package/dist/node_modules/uuid/dist/esm-browser/sha1.js +96 -0
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js +33 -0
- package/dist/node_modules/uuid/dist/esm-browser/v1.js +95 -0
- package/dist/node_modules/uuid/dist/esm-browser/v3.js +4 -0
- package/dist/node_modules/uuid/dist/esm-browser/v35.js +66 -0
- package/dist/node_modules/uuid/dist/esm-browser/v4.js +29 -0
- package/dist/node_modules/uuid/dist/esm-browser/v5.js +4 -0
- package/dist/node_modules/uuid/dist/esm-browser/validate.js +7 -0
- package/dist/node_modules/uuid/dist/esm-browser/version.js +11 -0
- package/dist/node_modules/uuid/dist/esm-node/index.js +9 -0
- package/dist/node_modules/uuid/dist/esm-node/md5.js +13 -0
- package/dist/node_modules/uuid/dist/esm-node/native.js +4 -0
- package/dist/node_modules/uuid/dist/esm-node/nil.js +1 -0
- package/dist/node_modules/uuid/dist/esm-node/parse.js +35 -0
- package/dist/node_modules/uuid/dist/esm-node/regex.js +1 -0
- package/dist/node_modules/uuid/dist/esm-node/rng.js +12 -0
- package/dist/node_modules/uuid/dist/esm-node/sha1.js +13 -0
- package/dist/node_modules/uuid/dist/esm-node/stringify.js +33 -0
- package/dist/node_modules/uuid/dist/esm-node/v1.js +95 -0
- package/dist/node_modules/uuid/dist/esm-node/v3.js +4 -0
- package/dist/node_modules/uuid/dist/esm-node/v35.js +66 -0
- package/dist/node_modules/uuid/dist/esm-node/v4.js +29 -0
- package/dist/node_modules/uuid/dist/esm-node/v5.js +4 -0
- package/dist/node_modules/uuid/dist/esm-node/validate.js +7 -0
- package/dist/node_modules/uuid/dist/esm-node/version.js +11 -0
- package/dist/node_modules/uuid/dist/index.js +1 -0
- package/dist/node_modules/uuid/dist/md5-browser.js +223 -0
- package/dist/node_modules/uuid/dist/md5.js +23 -0
- package/dist/node_modules/uuid/dist/native-browser.js +11 -0
- package/dist/node_modules/uuid/dist/native.js +15 -0
- package/dist/node_modules/uuid/dist/nil.js +8 -0
- package/dist/node_modules/uuid/dist/parse.js +45 -0
- package/dist/node_modules/uuid/dist/regex.js +8 -0
- package/dist/node_modules/uuid/dist/rng-browser.js +25 -0
- package/dist/node_modules/uuid/dist/rng.js +24 -0
- package/dist/node_modules/uuid/dist/sha1-browser.js +104 -0
- package/dist/node_modules/uuid/dist/sha1.js +23 -0
- package/dist/node_modules/uuid/dist/stringify.js +44 -0
- package/dist/node_modules/uuid/dist/uuid-bin.js +85 -0
- package/dist/node_modules/uuid/dist/v1.js +107 -0
- package/dist/node_modules/uuid/dist/v3.js +16 -0
- package/dist/node_modules/uuid/dist/v35.js +80 -0
- package/dist/node_modules/uuid/dist/v4.js +43 -0
- package/dist/node_modules/uuid/dist/v5.js +16 -0
- package/dist/node_modules/uuid/dist/validate.js +17 -0
- package/dist/node_modules/uuid/dist/version.js +21 -0
- package/dist/node_modules/uuid/package.json +1 -1
- package/dist/server/index.d.ts +8 -1
- package/dist/server/index.js +1 -3
- package/dist/server/plugin.d.ts +8 -0
- package/dist/server/plugin.js +2 -2
- package/dist/server/resourcers/async-tasks.d.ts +10 -0
- package/dist/server/resourcers/async-tasks.js +29 -2
- package/package.json +2 -2
- package/dist/node_modules/uuid/AUTHORS +0 -5
- package/dist/node_modules/uuid/bin/uuid +0 -65
- package/dist/node_modules/uuid/index.js +0 -1
- package/dist/node_modules/uuid/lib/bytesToUuid.js +0 -26
- package/dist/node_modules/uuid/lib/md5.js +0 -25
- package/dist/node_modules/uuid/lib/rng-browser.js +0 -34
- package/dist/node_modules/uuid/lib/rng.js +0 -8
- package/dist/node_modules/uuid/lib/sha1-browser.js +0 -89
- package/dist/node_modules/uuid/lib/sha1.js +0 -25
- package/dist/node_modules/uuid/lib/v35.js +0 -57
- package/dist/node_modules/uuid/v1.js +0 -109
- package/dist/node_modules/uuid/v3.js +0 -4
- package/dist/node_modules/uuid/v4.js +0 -29
- package/dist/node_modules/uuid/v5.js +0 -3
- package/dist/server/static-import.d.ts +0 -1
- package/dist/server/static-import.js +0 -39
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"uuid","version":"
|
|
1
|
+
{"name":"uuid","version":"9.0.1","description":"RFC4122 (v1, v4, and v5) UUIDs","funding":["https://github.com/sponsors/broofa","https://github.com/sponsors/ctavan"],"commitlint":{"extends":["@commitlint/config-conventional"]},"keywords":["uuid","guid","rfc4122"],"license":"MIT","bin":{"uuid":"./dist/bin/uuid"},"sideEffects":false,"main":"./dist/index.js","exports":{".":{"node":{"module":"./dist/esm-node/index.js","require":"./dist/index.js","import":"./wrapper.mjs"},"browser":{"import":"./dist/esm-browser/index.js","require":"./dist/commonjs-browser/index.js"},"default":"./dist/esm-browser/index.js"},"./package.json":"./package.json"},"module":"./dist/esm-node/index.js","browser":{"./dist/md5.js":"./dist/md5-browser.js","./dist/native.js":"./dist/native-browser.js","./dist/rng.js":"./dist/rng-browser.js","./dist/sha1.js":"./dist/sha1-browser.js","./dist/esm-node/index.js":"./dist/esm-browser/index.js"},"files":["CHANGELOG.md","CONTRIBUTING.md","LICENSE.md","README.md","dist","wrapper.mjs"],"devDependencies":{"@babel/cli":"7.18.10","@babel/core":"7.18.10","@babel/eslint-parser":"7.18.9","@babel/preset-env":"7.18.10","@commitlint/cli":"17.0.3","@commitlint/config-conventional":"17.0.3","bundlewatch":"0.3.3","eslint":"8.21.0","eslint-config-prettier":"8.5.0","eslint-config-standard":"17.0.0","eslint-plugin-import":"2.26.0","eslint-plugin-node":"11.1.0","eslint-plugin-prettier":"4.2.1","eslint-plugin-promise":"6.0.0","husky":"8.0.1","jest":"28.1.3","lint-staged":"13.0.3","npm-run-all":"4.1.5","optional-dev-dependency":"2.0.1","prettier":"2.7.1","random-seed":"0.3.0","runmd":"1.3.9","standard-version":"9.5.0"},"optionalDevDependencies":{"@wdio/browserstack-service":"7.16.10","@wdio/cli":"7.16.10","@wdio/jasmine-framework":"7.16.6","@wdio/local-runner":"7.16.10","@wdio/spec-reporter":"7.16.9","@wdio/static-server-service":"7.16.6"},"scripts":{"examples:browser:webpack:build":"cd examples/browser-webpack && npm install && npm run build","examples:browser:rollup:build":"cd examples/browser-rollup && npm install && npm run build","examples:node:commonjs:test":"cd examples/node-commonjs && npm install && npm test","examples:node:esmodules:test":"cd examples/node-esmodules && npm install && npm test","examples:node:jest:test":"cd examples/node-jest && npm install && npm test","prepare":"cd $( git rev-parse --show-toplevel ) && husky install","lint":"npm run eslint:check && npm run prettier:check","eslint:check":"eslint src/ test/ examples/ *.js","eslint:fix":"eslint --fix src/ test/ examples/ *.js","pretest":"[ -n $CI ] || npm run build","test":"BABEL_ENV=commonjsNode node --throw-deprecation node_modules/.bin/jest test/unit/","pretest:browser":"optional-dev-dependency && npm run build && npm-run-all --parallel examples:browser:**","test:browser":"wdio run ./wdio.conf.js","pretest:node":"npm run build","test:node":"npm-run-all --parallel examples:node:**","test:pack":"./scripts/testpack.sh","pretest:benchmark":"npm run build","test:benchmark":"cd examples/benchmark && npm install && npm test","prettier:check":"prettier --check '**/*.{js,jsx,json,md}'","prettier:fix":"prettier --write '**/*.{js,jsx,json,md}'","bundlewatch":"npm run pretest:browser && bundlewatch --config bundlewatch.config.json","md":"runmd --watch --output=README.md README_js.md","docs":"( node --version | grep -q 'v18' ) && ( npm run build && npx runmd --output=README.md README_js.md )","docs:diff":"npm run docs && git diff --quiet README.md","build":"./scripts/build.sh","prepack":"npm run build","release":"standard-version --no-verify"},"repository":{"type":"git","url":"https://github.com/uuidjs/uuid.git"},"lint-staged":{"*.{js,jsx,json,md}":["prettier --write"],"*.{js,jsx}":["eslint --fix"]},"standard-version":{"scripts":{"postchangelog":"prettier --write CHANGELOG.md"}},"_lastModified":"2025-04-23T10:31:29.719Z"}
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
1
9
|
export * from './interfaces/async-task-manager';
|
|
2
10
|
export * from './task-type';
|
|
3
|
-
export * from './static-import';
|
|
4
11
|
export { default } from './plugin';
|
package/dist/server/index.js
CHANGED
|
@@ -42,11 +42,9 @@ __export(server_exports, {
|
|
|
42
42
|
module.exports = __toCommonJS(server_exports);
|
|
43
43
|
__reExport(server_exports, require("./interfaces/async-task-manager"), module.exports);
|
|
44
44
|
__reExport(server_exports, require("./task-type"), module.exports);
|
|
45
|
-
__reExport(server_exports, require("./static-import"), module.exports);
|
|
46
45
|
var import_plugin = __toESM(require("./plugin"));
|
|
47
46
|
// Annotate the CommonJS export names for ESM import in node:
|
|
48
47
|
0 && (module.exports = {
|
|
49
48
|
...require("./interfaces/async-task-manager"),
|
|
50
|
-
...require("./task-type")
|
|
51
|
-
...require("./static-import")
|
|
49
|
+
...require("./task-type")
|
|
52
50
|
});
|
package/dist/server/plugin.d.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
1
9
|
import { Plugin } from '@nocobase/server';
|
|
2
10
|
export declare class PluginAsyncExportServer extends Plugin {
|
|
3
11
|
private progressThrottles;
|
package/dist/server/plugin.js
CHANGED
|
@@ -41,10 +41,10 @@ __export(plugin_exports, {
|
|
|
41
41
|
});
|
|
42
42
|
module.exports = __toCommonJS(plugin_exports);
|
|
43
43
|
var import_server = require("@nocobase/server");
|
|
44
|
+
var import_lodash = require("lodash");
|
|
44
45
|
var import_base_task_manager = require("./base-task-manager");
|
|
45
46
|
var import_command_task_type = require("./command-task-type");
|
|
46
47
|
var import_async_tasks = __toESM(require("./resourcers/async-tasks"));
|
|
47
|
-
var import_lodash = require("lodash");
|
|
48
48
|
class PluginAsyncExportServer extends import_server.Plugin {
|
|
49
49
|
progressThrottles = /* @__PURE__ */ new Map();
|
|
50
50
|
async afterAdd() {
|
|
@@ -57,7 +57,7 @@ class PluginAsyncExportServer extends import_server.Plugin {
|
|
|
57
57
|
return manager;
|
|
58
58
|
});
|
|
59
59
|
this.app.container.get("AsyncTaskManager").registerTaskType(import_command_task_type.CommandTaskType);
|
|
60
|
-
this.app.acl.allow("asyncTasks", ["get", "fetchFile"], "loggedIn");
|
|
60
|
+
this.app.acl.allow("asyncTasks", ["list", "get", "fetchFile", "cancel"], "loggedIn");
|
|
61
61
|
}
|
|
62
62
|
getThrottledProgressEmitter(taskId, userId) {
|
|
63
63
|
if (!this.progressThrottles.has(taskId)) {
|
|
@@ -1,7 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
1
9
|
declare const _default: {
|
|
2
10
|
name: string;
|
|
3
11
|
actions: {
|
|
12
|
+
list(ctx: any, next: any): Promise<void>;
|
|
4
13
|
get(ctx: any, next: any): Promise<void>;
|
|
14
|
+
cancel(ctx: any, next: any): Promise<void>;
|
|
5
15
|
fetchFile(ctx: any, next: any): Promise<void>;
|
|
6
16
|
};
|
|
7
17
|
};
|
|
@@ -40,10 +40,18 @@ __export(async_tasks_exports, {
|
|
|
40
40
|
});
|
|
41
41
|
module.exports = __toCommonJS(async_tasks_exports);
|
|
42
42
|
var import_fs = __toESM(require("fs"));
|
|
43
|
+
var import_lodash = __toESM(require("lodash"));
|
|
43
44
|
var import_path = require("path");
|
|
44
45
|
var async_tasks_default = {
|
|
45
46
|
name: "asyncTasks",
|
|
46
47
|
actions: {
|
|
48
|
+
async list(ctx, next) {
|
|
49
|
+
const userId = ctx.auth.user.id;
|
|
50
|
+
const asyncTaskManager = ctx.app.container.get("AsyncTaskManager");
|
|
51
|
+
const tasks = await asyncTaskManager.getTasksByTag("userId", userId);
|
|
52
|
+
ctx.body = import_lodash.default.orderBy(tasks, "createdAt", "desc");
|
|
53
|
+
await next();
|
|
54
|
+
},
|
|
47
55
|
async get(ctx, next) {
|
|
48
56
|
const { filterByTk } = ctx.action.params;
|
|
49
57
|
const taskManager = ctx.app.container.get("AsyncTaskManager");
|
|
@@ -51,8 +59,25 @@ var async_tasks_default = {
|
|
|
51
59
|
ctx.body = taskStatus;
|
|
52
60
|
await next();
|
|
53
61
|
},
|
|
54
|
-
async
|
|
62
|
+
async cancel(ctx, next) {
|
|
55
63
|
const { filterByTk } = ctx.action.params;
|
|
64
|
+
const userId = ctx.auth.user.id;
|
|
65
|
+
const asyncTaskManager = ctx.app.container.get("AsyncTaskManager");
|
|
66
|
+
const task = asyncTaskManager.getTask(filterByTk);
|
|
67
|
+
if (!task) {
|
|
68
|
+
ctx.body = "ok";
|
|
69
|
+
await next();
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (task.tags["userId"] != userId) {
|
|
73
|
+
ctx.throw(403);
|
|
74
|
+
}
|
|
75
|
+
const cancelled = await asyncTaskManager.cancelTask(filterByTk);
|
|
76
|
+
ctx.body = cancelled;
|
|
77
|
+
await next();
|
|
78
|
+
},
|
|
79
|
+
async fetchFile(ctx, next) {
|
|
80
|
+
const { filterByTk, filename } = ctx.action.params;
|
|
56
81
|
const taskManager = ctx.app.container.get("AsyncTaskManager");
|
|
57
82
|
const taskStatus = await taskManager.getTaskStatus(filterByTk);
|
|
58
83
|
if (taskStatus.type !== "success") {
|
|
@@ -63,9 +88,11 @@ var async_tasks_default = {
|
|
|
63
88
|
throw new Error("not a file task");
|
|
64
89
|
}
|
|
65
90
|
ctx.body = import_fs.default.createReadStream(filePath);
|
|
91
|
+
let finalFileName = filename ? filename : (0, import_path.basename)(filePath);
|
|
92
|
+
finalFileName = encodeURIComponent(finalFileName);
|
|
66
93
|
ctx.set({
|
|
67
94
|
"Content-Type": "application/octet-stream",
|
|
68
|
-
"Content-Disposition": `attachment; filename=${
|
|
95
|
+
"Content-Disposition": `attachment; filename=${finalFileName}`
|
|
69
96
|
});
|
|
70
97
|
await next();
|
|
71
98
|
}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "异步任务管理器",
|
|
5
5
|
"description": "Manage and monitor asynchronous tasks such as data import/export. Support task progress tracking and notification.",
|
|
6
6
|
"description.zh-CN": "管理和监控数据导入导出等异步任务。支持任务进度跟踪和通知。",
|
|
7
|
-
"version": "1.7.0-beta.
|
|
7
|
+
"version": "1.7.0-beta.21",
|
|
8
8
|
"main": "dist/server/index.js",
|
|
9
9
|
"peerDependencies": {
|
|
10
10
|
"@nocobase/client": "1.x",
|
|
@@ -12,5 +12,5 @@
|
|
|
12
12
|
"@nocobase/server": "1.x",
|
|
13
13
|
"@nocobase/test": "1.x"
|
|
14
14
|
},
|
|
15
|
-
"gitHead": "
|
|
15
|
+
"gitHead": "845f6124b170717387ba9d7ebf3cc2df7a861bc3"
|
|
16
16
|
}
|
|
@@ -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 +0,0 @@
|
|
|
1
|
-
(function(){var r={155:function(r,e,n){var a=n(749);var t=n(824);var i=t;i.v1=a;i.v4=t;r.exports=i},707:function(r){var e=[];for(var n=0;n<256;++n){e[n]=(n+256).toString(16).substr(1)}function bytesToUuid(r,n){var a=n||0;var t=e;return[t[r[a++]],t[r[a++]],t[r[a++]],t[r[a++]],"-",t[r[a++]],t[r[a++]],"-",t[r[a++]],t[r[a++]],"-",t[r[a++]],t[r[a++]],"-",t[r[a++]],t[r[a++]],t[r[a++]],t[r[a++]],t[r[a++]],t[r[a++]]].join("")}r.exports=bytesToUuid},859:function(r,e,n){var a=n(113);r.exports=function nodeRNG(){return a.randomBytes(16)}},749:function(r,e,n){var a=n(859);var t=n(707);var i;var u;var o=0;var v=0;function v1(r,e,n){var f=e&&n||0;var s=e||[];r=r||{};var c=r.node||i;var _=r.clockseq!==undefined?r.clockseq:u;if(c==null||_==null){var d=a();if(c==null){c=i=[d[0]|1,d[1],d[2],d[3],d[4],d[5]]}if(_==null){_=u=(d[6]<<8|d[7])&16383}}var l=r.msecs!==undefined?r.msecs:(new Date).getTime();var p=r.nsecs!==undefined?r.nsecs:v+1;var x=l-o+(p-v)/1e4;if(x<0&&r.clockseq===undefined){_=_+1&16383}if((x<0||l>o)&&r.nsecs===undefined){p=0}if(p>=1e4){throw new Error("uuid.v1(): Can't create more than 10M uuids/sec")}o=l;v=p;u=_;l+=122192928e5;var b=((l&268435455)*1e4+p)%4294967296;s[f++]=b>>>24&255;s[f++]=b>>>16&255;s[f++]=b>>>8&255;s[f++]=b&255;var y=l/4294967296*1e4&268435455;s[f++]=y>>>8&255;s[f++]=y&255;s[f++]=y>>>24&15|16;s[f++]=y>>>16&255;s[f++]=_>>>8|128;s[f++]=_&255;for(var q=0;q<6;++q){s[f+q]=c[q]}return e?e:t(s)}r.exports=v1},824:function(r,e,n){var a=n(859);var t=n(707);function v4(r,e,n){var i=e&&n||0;if(typeof r=="string"){e=r==="binary"?new Array(16):null;r=null}r=r||{};var u=r.random||(r.rng||a)();u[6]=u[6]&15|64;u[8]=u[8]&63|128;if(e){for(var o=0;o<16;++o){e[i+o]=u[o]}}return e||t(u)}r.exports=v4},113:function(r){"use strict";r.exports=require("crypto")}};var e={};function __nccwpck_require__(n){var a=e[n];if(a!==undefined){return a.exports}var t=e[n]={exports:{}};var i=true;try{r[n](t,t.exports,__nccwpck_require__);i=false}finally{if(i)delete e[n]}return t.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var n=__nccwpck_require__(155);module.exports=n})();
|
|
@@ -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
|
-
};
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
var rng = require('./lib/rng');
|
|
2
|
-
var bytesToUuid = require('./lib/bytesToUuid');
|
|
3
|
-
|
|
4
|
-
// **`v1()` - Generate time-based UUID**
|
|
5
|
-
//
|
|
6
|
-
// Inspired by https://github.com/LiosK/UUID.js
|
|
7
|
-
// and http://docs.python.org/library/uuid.html
|
|
8
|
-
|
|
9
|
-
var _nodeId;
|
|
10
|
-
var _clockseq;
|
|
11
|
-
|
|
12
|
-
// Previous uuid creation time
|
|
13
|
-
var _lastMSecs = 0;
|
|
14
|
-
var _lastNSecs = 0;
|
|
15
|
-
|
|
16
|
-
// See https://github.com/uuidjs/uuid for API details
|
|
17
|
-
function v1(options, buf, offset) {
|
|
18
|
-
var i = buf && offset || 0;
|
|
19
|
-
var b = buf || [];
|
|
20
|
-
|
|
21
|
-
options = options || {};
|
|
22
|
-
var node = options.node || _nodeId;
|
|
23
|
-
var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;
|
|
24
|
-
|
|
25
|
-
// node and clockseq need to be initialized to random values if they're not
|
|
26
|
-
// specified. We do this lazily to minimize issues related to insufficient
|
|
27
|
-
// system entropy. See #189
|
|
28
|
-
if (node == null || clockseq == null) {
|
|
29
|
-
var seedBytes = rng();
|
|
30
|
-
if (node == null) {
|
|
31
|
-
// Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
|
|
32
|
-
node = _nodeId = [
|
|
33
|
-
seedBytes[0] | 0x01,
|
|
34
|
-
seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]
|
|
35
|
-
];
|
|
36
|
-
}
|
|
37
|
-
if (clockseq == null) {
|
|
38
|
-
// Per 4.2.2, randomize (14 bit) clockseq
|
|
39
|
-
clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// UUID timestamps are 100 nano-second units since the Gregorian epoch,
|
|
44
|
-
// (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
|
|
45
|
-
// time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
|
|
46
|
-
// (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
|
|
47
|
-
var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();
|
|
48
|
-
|
|
49
|
-
// Per 4.2.1.2, use count of uuid's generated during the current clock
|
|
50
|
-
// cycle to simulate higher resolution clock
|
|
51
|
-
var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;
|
|
52
|
-
|
|
53
|
-
// Time since last uuid creation (in msecs)
|
|
54
|
-
var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;
|
|
55
|
-
|
|
56
|
-
// Per 4.2.1.2, Bump clockseq on clock regression
|
|
57
|
-
if (dt < 0 && options.clockseq === undefined) {
|
|
58
|
-
clockseq = clockseq + 1 & 0x3fff;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
|
|
62
|
-
// time interval
|
|
63
|
-
if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
|
|
64
|
-
nsecs = 0;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// Per 4.2.1.2 Throw error if too many uuids are requested
|
|
68
|
-
if (nsecs >= 10000) {
|
|
69
|
-
throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
_lastMSecs = msecs;
|
|
73
|
-
_lastNSecs = nsecs;
|
|
74
|
-
_clockseq = clockseq;
|
|
75
|
-
|
|
76
|
-
// Per 4.1.4 - Convert from unix epoch to Gregorian epoch
|
|
77
|
-
msecs += 12219292800000;
|
|
78
|
-
|
|
79
|
-
// `time_low`
|
|
80
|
-
var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
|
|
81
|
-
b[i++] = tl >>> 24 & 0xff;
|
|
82
|
-
b[i++] = tl >>> 16 & 0xff;
|
|
83
|
-
b[i++] = tl >>> 8 & 0xff;
|
|
84
|
-
b[i++] = tl & 0xff;
|
|
85
|
-
|
|
86
|
-
// `time_mid`
|
|
87
|
-
var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;
|
|
88
|
-
b[i++] = tmh >>> 8 & 0xff;
|
|
89
|
-
b[i++] = tmh & 0xff;
|
|
90
|
-
|
|
91
|
-
// `time_high_and_version`
|
|
92
|
-
b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
|
|
93
|
-
b[i++] = tmh >>> 16 & 0xff;
|
|
94
|
-
|
|
95
|
-
// `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
|
|
96
|
-
b[i++] = clockseq >>> 8 | 0x80;
|
|
97
|
-
|
|
98
|
-
// `clock_seq_low`
|
|
99
|
-
b[i++] = clockseq & 0xff;
|
|
100
|
-
|
|
101
|
-
// `node`
|
|
102
|
-
for (var n = 0; n < 6; ++n) {
|
|
103
|
-
b[i + n] = node[n];
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
return buf ? buf : bytesToUuid(b);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
module.exports = v1;
|