Calculate Game Protocol Version Hash
Closed this issue · 1 comments
Aim4kill commented
Server/src/session/models/game_manager.rs
Line 643 in b616a71
In my own blaze emulator i am using this to calculate the game protocol version hash, here you can see it in C#. It appears to be FNV1 hash but in a bit different way. When i tested this against EA generated hashes, they were matching.
I am not familiar with Rust at all, so it is better i let it up to you to implement it :D
public static ulong GetGameProtocolVersionHash(string protocolVersion)
{
protocolVersion ??= string.Empty;
//FNV1 HASH - the same hashing logic is used in ea blaze for game protocol versions
byte[] buf = Encoding.UTF8.GetBytes(protocolVersion);
ulong hash = 2166136261UL;
foreach (byte c in buf)
hash = (hash * 16777619) ^ c;
return hash;
}
jacobtread commented
Thanks, implemented in 398410d