binarylogic/authlogic — pull request #336 by kulpreet (2012-11-08 10:19:20+00:00)
Title: SHA crypto providers: Compare hex values as integers

The SHA1, SHA256 and SHA512 crypto providers are using string comparison to verify if a password matches.

```encrypt(*tokens) == crypted```

Which works fine if authlogic is used to generate and match the crypted_password.

However, I recently faced a solution where another system had to create and verify users and passwords. All was well till we realised that that other system was generating hex string with upper case characters. Like "AB10" instead of "ab10".

I think the crypto providers that generate hex should compare them using integer comparison. All we have to do it to_i(16) on both sides of the comparison to get it going.

The pull requests does just that. No changes needed for tests, as the tests are passing strings, which would be the case from the database, and we just convert the hex strings to integers and compare them.