August 2003
Intermediate to advanced
1140 pages
68h 45m
English
Hash
Hash(string)One-way encrypts string using the MD5 hash
algorithm. The resulting string is a 32-character hexadecimal
representation of the original string. Because the MD5 algorithm is a
one-way hash, there is no way to decrypt the encrypted string. The
Hash( ) function is often used to hash passwords
before storing them in a database. This allows you to store passwords
in a database without being able to see the actual password. When
building an application that uses hashed passwords for
authentication, the password entered by the user should be hashed,
then compared to the hashed value stored in the database. If they
match, you know the user entered a valid password.
Here’s an example using the Hash(
) function:
<cfoutput># Hash('This is a test')#</cfoutput>