diff -r 34a0181d5be5 -r 64a5ab2c4f00 share/hedgewars/Data/Scripts/OfficialChallenges.lua --- a/share/hedgewars/Data/Scripts/OfficialChallenges.lua Tue Feb 09 15:27:55 2016 -0500 +++ b/share/hedgewars/Data/Scripts/OfficialChallenges.lua Fri Feb 12 17:03:42 2016 +0300 @@ -45,3 +45,26 @@ end end end + +-- modified Adler hash +local hashA = 0 +local hashB = 0 +local hashModule = 299993 + +function resetHash() + hashA = 0 + hashB = 0 +end + +function addHashData(i) + hashA = (hashA + i + 65536) % hashModule + hashB = (hashB + hashA) % hashModule +end + +function hashDigest() + return(hashB * hashModule + hashA) +end + +function detectMapWithDigest() + return("map " .. hashDigest()) +end