Skip to content

Instantly share code, notes, and snippets.

@virtix
Created June 23, 2009 18:57
Show Gist options
  • Save virtix/134752 to your computer and use it in GitHub Desktop.
Save virtix/134752 to your computer and use it in GitHub Desktop.
<cffunction name="genBinarySalt" access="private" returnType="binary" output="no">
<cfargument name="size" type="numeric" required="true"/>
<cfscript>
var byteType = createObject('java', 'java.lang.Byte').TYPE;
var bytes = createObject('java','java.lang.reflect.Array').newInstance( byteType , size);
var rand = createObject('java', 'java.security.SecureRandom').nextBytes(bytes);
return bytes;
</cfscript>
</cffunction>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment