private String generateRandomSession ( ) { final int length = 16 ; final SecureRandom r = new SecureRandom ( ) ; final StringBuilder sb = new StringBuilder ( ) ; while ( sb . length ( ) < length ) { sb . append ( Integer . toHexString ( r . nextInt ( ) ) ) ; } return sb . toString ( ) . substring ( 0 , length ) ; }
Generates a random 16 character lower - case hex string .