Java Digest digestInit()

Here you can find the source of digestInit()

Description

digest Init

License

Open Source License

Declaration

protected static MessageDigest digestInit() throws Exception 

Method Source Code

//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;
    }
}

Related

  1. digestBySHA256(byte[] source)
  2. digestBytes(String type, byte[]... data)
  3. digestEncrypte(byte[] plainText, String algorithm)
  4. digestHex(String txt)
  5. digestHmacToBase64(String algorithm, String msg, byte[] privateKey)
  6. digestOperation(String algo, byte[]... content)
  7. digestStream(MessageDigest digest, InputStream is)
  8. digestString(MessageDigest md, String s)
  9. digestString(String input)