This commit is contained in:
Lukas Nowy 2019-04-07 19:57:04 +02:00
parent d6f3269d6c
commit d94d1175db
2 changed files with 14 additions and 6 deletions

View File

@ -1,9 +1,5 @@
const {
Client
} = require("pg");
const {
postgresSQL
} = require("./keys")
const {Client} = require("pg");
const {postgresSQL} = require("./keys");
const client = new Client(postgresSQL);

View File

@ -534,6 +534,18 @@ function generate_group_id() {
return output;
}
//Random ID generate
function genID(length) {
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
var output = "";
for (let i = 0; i < length; i++) {
output += possible.charAt(Math.floor(Math.random() * possible.length));
}
return output;
}
//item_id generieren
function generate_item_id() {
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";