Generate instance ID separate from rcon password

Create a random instance ID using Math.random instead of deriving it
from the RCON password with a hombrew hash algorithm.  Remove
stringUtils as it's no longer needed.
This commit is contained in:
Hornwitser committed 2019-10-14 15:51:45 +02:00
1 parent 33e9f9d983
commit 6b4ab6660c
5 files changed
+9 -64

No files matched your search

-13
View File
@@ -1,13 +0,0 @@
function hashCode(string){
if(typeof string !== "string") throw "ERROR stringUtils: Not a string";
var hash = 0;
if (string.length == 0) return hash;
for (let i = 0; i < string.length; i++) {
hash = ((hash << 5) - hash) + string.charCodeAt(i);
hash = hash & hash; // Convert to 32bit integer
}
return hash;
}
module.exports = {
hashCode: hashCode,
}