Here you can find the source of dataDigest(String in)
private static byte[] dataDigest(String in) throws NoSuchAlgorithmException, UnsupportedEncodingException
//package com.java2s; import java.io.UnsupportedEncodingException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { private static byte[] dataDigest(String in) throws NoSuchAlgorithmException, UnsupportedEncodingException { if (in == null) return null; MessageDigest md = MessageDigest.getInstance("SHA-1"); return md.digest(in.getBytes("UTF8")); }//from w w w . j av a2s. co m }