I have an application that uses Users as keys to a hash. When a user renames himself, Cinch will update the User instance to match the new nick. However, the problem is that this will also change the output of User.hash, and will require a rehash or else the key-value pair will be unaccessible.
My alternative is to use the host in the hash method, rather than the nick. The host will not always be unique which means hash lookups will be slower, but the host won't change and makes for a better hash function in general. Let me know what you guys.
I have an application that uses Users as keys to a hash. When a user renames himself, Cinch will update the User instance to match the new nick. However, the problem is that this will also change the output of User.hash, and will require a rehash or else the key-value pair will be unaccessible.
My alternative is to use the host in the hash method, rather than the nick. The host will not always be unique which means hash lookups will be slower, but the host won't change and makes for a better hash function in general. Let me know what you guys.