I was wondering whether md5, sha1 and anothers return unique values.
For example, sha1()
for test
returns a94a8fe5ccb19ba61c4c0873d391e987982fbbd3
, which is 40 characters long. So, sha1 for strings larger than 40 chars must be the same (of course it's scrambled, because the given input may contain whitespaces and special chars etc.).
Due to this, when we are storing users' passwords, they can enter either their original password or some super-long one, which nobody knows.
Is this right, or do these hash algorithms provide really unique results - I'm quite sure it's hardly possible.