Hash strings to INT using Java

James Moberg - Feb 3 '22 - - Dev Community

I'm not sure where I previously learned about the Java hashCode() method for strings, but it enabled us to quickly assign a unique-ish numerical hash from a textual product configuration and enabled us to search, group & report data where it would have been very difficult otherwise.

The hashCode() method works in Adobe ColdFusion 8-2021. I also tested it using CFTry.com and Railo + Lucee4 worked, but Lucee5 didn't return anything so I'm not sure if it works or not.

Here's the gist:
https://gist.github.com/JamoCA/e94b1100932db2c02b18eb11afc56079

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .