UNPKG

@verdaccio/config

Version:
18 lines (16 loc) 516 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TOKEN_VALID_LENGTH = void 0; exports.generateRandomSecretKey = generateRandomSecretKey; var _crypto = require("crypto"); const TOKEN_VALID_LENGTH = 32; /** * Secret key must have 32 characters. */ exports.TOKEN_VALID_LENGTH = TOKEN_VALID_LENGTH; function generateRandomSecretKey() { return (0, _crypto.randomBytes)(TOKEN_VALID_LENGTH).toString('base64').substring(0, TOKEN_VALID_LENGTH); } //# sourceMappingURL=token.js.map