im stupid

This commit is contained in:
Lawin0129
2022-03-09 19:34:13 +00:00
parent 8cf7e405bf
commit 4ea28d4955
3 changed files with 17 additions and 7 deletions

14
package-lock.json generated
View File

@@ -14,6 +14,7 @@
"fs": "^0.0.1-security",
"ini": "^2.0.0",
"path": "^0.12.7",
"uuid": "^8.3.2",
"ws": "^8.5.0",
"xml-parser": "^1.2.1",
"xmlbuilder": "^15.1.1"
@@ -552,6 +553,14 @@
"node": ">= 0.4.0"
}
},
"node_modules/uuid": {
"version": "8.3.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
"bin": {
"uuid": "dist/bin/uuid"
}
},
"node_modules/vary": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
@@ -1003,6 +1012,11 @@
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
"integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
},
"uuid": {
"version": "8.3.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
},
"vary": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",

View File

@@ -9,6 +9,7 @@
"fs": "^0.0.1-security",
"ini": "^2.0.0",
"path": "^0.12.7",
"uuid": "^8.3.2",
"ws": "^8.5.0",
"xml-parser": "^1.2.1",
"xmlbuilder": "^15.1.1"

View File

@@ -1,6 +1,6 @@
const crypto = require("crypto");
const memory = require("./../memory.json");
const XMLBuilder = require("xmlbuilder");
const uuid = require("uuid");
function GetVersionInfo(req, memory) {
if (req.headers["user-agent"])
@@ -227,12 +227,7 @@ function getContentPages(req) {
}
function MakeID() {
let CurrentDate = (new Date()).valueOf().toString();
let RandomFloat = Math.random().toString();
let ID = crypto.createHash('md5').update(CurrentDate + RandomFloat).digest('hex');
let FinishedID = ID.slice(0, 8) + "-" + ID.slice(8, 12) + "-" + ID.slice(12, 16) + "-" + ID.slice(16, 20) + "-" + ID.slice(20, 32);
return FinishedID;
return uuid.v4();
}
function sendXmppMessageToAll(body) {