Here you can find the source of getHash(String strDate)
public static byte[] getHash(String strDate) throws Exception
//package com.java2s; import java.security.MessageDigest; public class Main { public static byte[] getHash(String strDate) throws Exception { byte[] strDateByte = strDate.getBytes(); MessageDigest md = MessageDigest.getInstance("SHA-1"); md.update(strDateByte, 0, strDateByte.length); return md.digest(); }/*w ww . j av a 2 s .c o m*/ public static byte[] getHash(byte[] strDate) throws Exception { MessageDigest md = MessageDigest.getInstance("SHA-1"); md.update(strDate, 0, strDate.length); return md.digest(); } }