Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
<cffunction name="genSalt" access="public" returnType="string">
<cfargument name="size" type="numeric" required="false" default="16" />
var byteType = createObject('java', 'java.lang.Byte').TYPE;
var bytes = createObject('java','java.lang.reflect.Array').newInstance( byteType , size);
var rand = createObject('java', '').nextBytes(bytes);
return toBase64(bytes);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment