i want to cache some search results based on the object to search and some search settings.
However: this creates quite a long cache key, and i thought i'd create a shortcut for it, and i thought i'd use GetHashCode()
for it.
So i was wondering, does GetHashCode()
always generate a different number, even when i have very long strings or differ only by this: 'ä' in stead of 'a'
I tried some strings and it seemed the answer is yes, but not understanding the GetHashCode()
behaviour doesn't give me the true feeling i am right.
And because it is one of those things which will pop up when you're not prepared (the client is looking at cached results for the wrong search) i want to be sure...
EDIT: if MD5 would work, i can change my code not to use the GetHashCode ofcourse, the goals is to get a short(er) string than the original (> 1000 chars)