Converts a string into a fixed length hexadecimal string.
NOTE: The result is useful for comparison and validation, such as storing and validating a hashed password without exposing the original password.
hash(string [, algorithm [, encoding]] [, additionalIterations])
→ returns string
MD5CFMX_COMPATMD5SHASHA-256SHA-384SHA-512UTF-8defaultCharset in the neo-runtime.xml file, which is normally UTF-8. CFMX_COMPAT algorithm.
utf-8iso-8859-1windows-1252us-asciishift_jisiso-2022-jpeuc-jpeuc-krbig5euc-cnutf-160CFMX_COMPAT default algorithm is used.
additionalIterations as the iterations param.
numIterations.
Returns 64 character hex result.
hash("something", "SHA-256", "UTF-8")
Expected Result: 3FC9B689459D738F8C88A3A48AA9E33542016B7A4052E001AAA536FCA74813CB
MD5 is not recommended for use requiring security.
hash("something")
Expected Result: 437B930DB84B8079C2DD804A71936B5F
Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.