I’m trying to calculate password entropy in ColdFusion (I know I could do it in JavaScript, but I like everything to work on the server as well as the client). In order to do so I need to be able to do a Log Base 2.
ColdFusion has a Log() function for a natural log and a Log10 for a Log Base 10, but I don’t see any function that lets me determine the base for the Log.
I assume that I need to drop down to Java to do this, but I am not sure the best way to do that.
if you do
log(x)/log(2)this is equivalent to log base 2 of x