mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-17 15:33:12 +09:00
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:
1 parent
33e9f9d983
commit
6b4ab6660c
5 files changed
+9
-64
No files matched your search
@@ -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,
|
||||
}
|
||||
Reference in new issue
Block a user