public static String genAuthCode ( User user ) { // concatenate a bunch of secret stuff together StringBuilder buf = new StringBuilder ( ) ; buf . append ( user . password ) ; buf . append ( System . currentTimeMillis ( ) ) ; buf . append ( Math . random ( ) ) ; // and MD5 hash it return StringUtil . md5hex ( buf . toString ( ) ) ; }
Generates a new random session identifier for the supplied user .