HTML Thin Client and Transactions
by Jean-Francois Touchette 
 
Listing One
public static byte[] generateTransactionTokenVersion1(String sessionId) {
   try {
    MessageDigest sha = MessageDigest.getInstance("SHA-1");
    sha.update( sessionId.getBytes() );
    Date d = new Date();
    long dl = d.getTime();
    sha.update( (Long.toString(dl)).getBytes() );
    return (sha.digest() );
   } catch (Exception e) {
    System.err.println("Caught exception " + e.toString());
   }
    return null;
 }


1


