Inital Commit
This commit is contained in:
17
html/rechner/node_modules/node-cron/dist/cjs/create-id.js
generated
vendored
Normal file
17
html/rechner/node_modules/node-cron/dist/cjs/create-id.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createID = createID;
|
||||
const node_crypto_1 = __importDefault(require("node:crypto"));
|
||||
function createID(prefix = '', length = 16) {
|
||||
const charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
const values = new Uint8Array(length);
|
||||
node_crypto_1.default.getRandomValues(values);
|
||||
const id = Array.from(values, v => charset[v % charset.length]).join('');
|
||||
if (prefix)
|
||||
return `${prefix}-${id}`;
|
||||
return id;
|
||||
}
|
||||
//# sourceMappingURL=create-id.js.map
|
||||
Reference in New Issue
Block a user