MCPcopy Create free account
hub / github.com/gnmyt/Nexterm / generateCode

Function generateCode

server/models/DeviceCode.js:7–14  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5const CODE_CHARSET = "ABCDEFGHJKMNPQRSTUVWXYZ23456789";
6
7const generateCode = () => {
8 let code = "";
9 for (let i = 0; i < 8; i++) {
10 if (i === 4) code += "-";
11 code += CODE_CHARSET[crypto.randomInt(CODE_CHARSET.length)];
12 }
13 return code;
14};
15
16module.exports = db.define("device_codes", {
17 code: {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected