public static byte [ ] randomBytes ( int n ) { byte [ ] buffer = new byte [ n ] ; if ( RandomUtils . secureRandom == null ) { try { RandomUtils . secureRandom = SecureRandom . getInstance ( ALGORITHM ) ; } catch ( NoSuchAlgorithmException e ) { e . printStackTrace ( ) ; } } RandomUtils . secureRandom . nextBytes ( buffer ) ; return buffer ; }
Generates a number random bytes specified by the user