Skip to content
0x2A edited this page Jul 15, 2012 · 4 revisions

*Hashes LoL loves to hash there strings and use those hashes to communicate with the client. I have no idea why they use that instead of a nice enum but anyways its what it is.

Lua

The lua hash function (credits to Intline9) is used to get an hash for an object.

unsigned int getHashObject(const char *str)
{
	unsigned int hash = 0;
	const char* gobj = "_gobj";
	for(unsigned int i = 0; i < strlen(str); i++)
		hash = tolower(str[i]) + (0x1003F * hash);
	for(unsigned int i = 0; i < strlen(gobj); i++)
		hash = tolower(gobj[i]) + (0x1003F * hash);
	return hash;
}

Game

They use a different hash function to encode the hash strings (credits Intline9).

unsigned int getHash(const char *str)
{
	unsigned int hash = 0;
	unsigned int mask = 0xF0000000;
	for(unsigned int i = 0; i < strlen(str); i++)
	{
		hash = tolower(str[i]) + (0x10 * hash);
		if(hash & mask)
			hash ^= hash & mask ^ ((hash & mask) >> 24);
	}
	return hash;
}

Spell hashes

All these values are retrieved by calling getHash on the string.

Spell String Value
Revive SummonerRevive 05C8B3A5
Smite SummonerSmite 065E8695
Exhaust SummonerExhaust 08A8BAE4
Barrier SummonerBarrier 0CCFB982
Teleport SummonerTeleport 004F1364
Ghost SummonerHaste 064ACC95
Heal SummonerHeal 0364AF1C
Cleanse SummonerBoost 064D2094
Clarity SummonerMana 03657421
Ignite SummonerDot 06364F24
Promote SummonerPromoteSR 0410FF72
Clairvoyance SummonerClairvoyance 09896765
Flash SummonerFlash 06496EA8
Surge SummonerBattleCry 0DA4F659
Barrier SummonerBarrier 0CCFB982
Garrison SummonerOdinGarrison 0D87AFEE
Test Force SummonerTestForceSpell 0103D94C

Perhaps there are some faults in this table and perhaps there are some spells missing

Clone this wiki locally