In the hexadecimal character set, case is non-significant (e.g. 'A3'
is equivalent to 'a3').  Consider specifying hex colors in CSS.

The canonical representation of an MD5 hash (or any other hash) is a
big ol' list of bits, not a string.  The string is just an encoding of
those bits into hex.  Since hex is not case-sensitive, there is no
difference between an uppercase and a lowercase encoding of the hash.
If, however, you care about the encoded version in a case sensitive
manner, then you need to supply that semantic yourself.  There's no
way that the hash algorithm could possibly do it for you.

cheers,
barneyb

On Thu, May 1, 2008 at 1:12 PM, Jim McAtee <[EMAIL PROTECTED]> wrote:
> CF's hash() function returns its output hex string with uppercase letters.
>  Generally not a problem if you only apply a single hash to a string, but
>  if you need to do multiple hashes, then the final outcome is unlikely to
>  match that of many other applications that use lower case hexadecimal
>  digits.  I just wasted more than an hour realizing this.
>
>  Trying to authenticate against a vBulletin user table, which uses a
>  hashing functon of
>
>  $hash = MD5(MD5($password) + $salt))
>
>  In CF, you need to force the intermediate string to lower case (and
>  optionally, do so to the finah string as well.
>
>  hashedpwd = lCase(hash(lCase(hash(form.password)) & user.salt))
>
>
>
>  

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:304616
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to