Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
lets say we have a hashtable from string to integer.
lets say we have a trigger that takes a player name and returns player id by looking it up from the hashtable. lets say we got 2 unlucky players A and B.
these players got different names but StringHash(GetPlayerName(A)) == StringHash(GetPlayerName(A))
thus if we get the name of player A from somewhere and look it up in the hashtable we might in stead get player B (because that was added last and overrode the original entry)
the main issue is that hashtables don't use the actual string as a key but the hash of the string. unless you specifically test for conflicts you will never know that 2 entries collide and the earlier one gets trampled and overwritten.
.....
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
lets say we have a trigger that takes a player name and returns player id by looking it up from the hashtable. lets say we got 2 unlucky players A and B.
these players got different names but StringHash(GetPlayerName(A)) == StringHash(GetPlayerName(A))
thus if we get the name of player A from somewhere and look it up in the hashtable we might in stead get player B (because that was added last and overrode the original entry)
the main issue is that hashtables don't use the actual string as a key but the hash of the string. unless you specifically test for conflicts you will never know that 2 entries collide and the earlier one gets trampled and overwritten.
.....