It is a password-hashing cryptographic function that takes an input and hashes it into a fixed size output./nNOTE: BCrypt input is limited to 72 bytes.
generateBCryptHash(plaintext,options);
→ returns string
{"version":"$2a","rounds":10}
This is an example of using the function with no options.
secretMsg=generateBCryptHash("My voice is my passport. Verify me.");writeDump(secretMsg)
Expected Result: $2a$10$.jQX1KnwPzhvVet0vEENnOlO8C70oM8GQhu0MQnCgcIlWhguWb3q.
This is an example of using the function with optional version specified.
secretMsg=generateBCryptHash("My voice is my passport. Verify me.",{"version":"$2b"});
writeDump(secretMsg)
Expected Result: $2b$10$wkfNE0B2hP/GMqQPWRvTte87F/PlEZwetaDPnVwW5OjBRAPiGKZp.
This is an example of using the function with optional rounds specified.
secretMsg=generateBCryptHash("Setec Astronomy",{"rounds":15});writeDump(secretMsg)
Expected Result: $2a$15$yBUewN8dYFd9QawytI5SO.MIq0hO65TXEoVyUAZRlK.oTHZ4Dwa0i
Signup for cfbreak
to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.