Parameter
Last updated on
11 January 2022
Description
It is a password-hashing cryptographic function that takes an input and hashes it into a fixed size output.
Syntax
GenerateBCryptHash(plaintext, options)
History
ColdFusion (2021 release): Added this function.
Parameters
|
Description |
---|---|
plaintext |
(Required) The input string on which the hash function must be run. |
options |
(Optional) A struct with the following values:
|
Example
<cfscript> stringToEncrypt = "Sample string" options = StructNew() options.rounds = 4 options.version = "$2a" bcrypted = GenerateBCryptHash(stringToEncrypt, options) writeDump(bcrypted) </cfscript>
Output
$2a$04$3rPqpEgx3CIZEVybl3myYu/IxZMttS5.DAX/WMZN8LYTCtU0oJY9G