Hash
645
Hash
Description
Converts a variable-length string to a fixed-length string that can act as a “fingerprint” or unique
identifier for the original string. It is not possible to convert the hash result back to the source
string.
Returns
A string.
Category
Conversion functions
,
Security functions
,
String functions
Function syntax
Hash
(
string
[,
algorithm
[,
encoding
]] )
History
ColdFusion MX 7: Added the
algorithm
and
encoding
parameters.
Parameters
Parameter
Description
string
String to hash.
algorithm
(Optional) The algorithm to use to hash the string. ColdFusion MX installs a
cryptography library with the following algorithms:
•
CFMX_COMPAT: Generates a hash string identical to that generated by
ColdFusion MX and ColdFusion MX 6.1 (default).
•
MD5: (Default) Generates a 32-character, hexadecimal string, using the MD5
algorithm (The algorithm used in ColdFusion MX and prior releases).
•
SHA: Generates a 28-character string using the Secure Hash Standard SHA-1
algorithm specified by Nation Institute of Standards and Technology (NIST)
FIPS-180-2.
•
SHA-256: Generates a 44-character string using the SHA-256 algorithm
specified by FIPS-180-2.
•
SHA-384: Generates a 64-character string using the SHA-384 algorithm
specified by FIPS-180-2.
•
SHA-512: Generates an 88-character string using the SHA-1 algorithm specified
by FIPS-180-2.
If you install a security provider with additional cryptography algorithms, you can
also specify any of its hashing algorithms.
encoding
(Optional; to use this attribute you must also specify the
algorithm
parameter) A
string specifying the encoding to use when converting the string to byte data used
by the hash algorithm. Must be a character encoding name recognized by the Java
runtime. The default value is the value specified by the defaultCharset entry in the
neo-runtime.xml file, which is normally UTF-8. Ignored when using the
CFMX_COMPAT algorithm.
Summary of Contents for COLFUSION MX 7 - INSTALLING AND USING COLDFUSION MX
Page 1: ...COLDFUSION MX7 CFML Reference...
Page 20: ...20 Chapter 1 Reserved Words and Variables...
Page 50: ...50 Chapter 2 ColdFusion Tags cfelse br Searching cfif cfloop cfif...
Page 101: ...cfdefaultcase 101 cfdefaultcase cfswitch cfoutput Your grade is grade cfoutput...
Page 115: ...cfdocumentsection 115 cfdocumentsection cfoutput cfdocument...
Page 411: ...cftable 411 cftable body html...
Page 515: ...Chr 515 maxlength 5 p input type Submit name input type RESET cfform...
Page 605: ...GetEncoding 605 WriteOutput The encoding is theEncoding cfscript cfif...
Page 629: ...GetProfileString 629 tr td input type Submit name Submit value Submit td td td tr table form...
Page 655: ...IIf 655 cfoutput IIf Hour Now GTE 12 DE It is afternoon or evening DE It is morning cfoutput b...
Page 664: ...664 Chapter 3 ColdFusion Functions cfelse h3 Conversion error h3 cfif...
Page 687: ...IsStruct 687 cfoutput cfquery cfif cfoutput hr Employee Add Complete cfoutput cfcase cfswitch...
Page 751: ...LSDateFormat 751 hr noshade cfoutput cfloop...
Page 861: ...StructFind 861 cfquery cfif cfoutput hr Employee Add Complete cfoutput cfcase cfswitch...
Page 903: ...Val 903 value Is the beginning numeric name form...
Page 932: ...932 Chapter 3 ColdFusion Functions...
Page 944: ...944 Chapter 4 ColdFusion MX Flash Form Style Reference...
Page 962: ...962 Chapter 5 Application CFC Reference...
Page 1054: ...1054 Chapter 6 ColdFusion MX Event Gateway Reference...