Here you can find the source of digestInit()
protected static MessageDigest digestInit() throws Exception
//package com.java2s; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { /** MD5 *//*from w ww. jav a 2s . c o m*/ public final static String MD5 = "MD5"; protected static MessageDigest digestInit() throws Exception { return digestInit(MD5); } protected static MessageDigest digestInit(String digestType) throws Exception { MessageDigest messagedigest = null; try { messagedigest = MessageDigest.getInstance(digestType); } catch (NoSuchAlgorithmException e) { throw new Exception(e); } return messagedigest; } }