🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!
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.
.....