id gen
This commit is contained in:
parent
d6f3269d6c
commit
d94d1175db
@ -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);
|
||||
|
||||
|
@ -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";
|
||||
|
Loading…
x
Reference in New Issue
Block a user