Archive for December, 2008

Find me on twitter

Dec 31 2008

If you are on twitter, you can find me at twitter.com/diovo

Follow me if you want updates from my side.

As is the case with this blog, I won’t say anything if I don’t have anything to say. I promise you that I will be sending tweets worth your time your way!!!

2 responses so far

Hashing is not a substitute for string comparison

Dec 01 2008

The last day I saw an interesting abuse of hash functions.

In an application that processed strings, there was a part where it compared medium sized strings. Instead of using the in-built string comparison routine, they calculated the hash values of the strings and compared the hashes. Clever?

Wrong!

Finding the hash value (MD5 in this case) of a string is an expensive task. If you do not retain the hash values for future purposes, just compare the strings directly to know whether they are equal.

4 responses so far