Java Digest digestOperation(String algo, byte[]... content)

Here you can find the source of digestOperation(String algo, byte[]... content)

Description

digest Operation

License

Open Source License

Declaration

private static byte[] digestOperation(String algo, byte[]... content) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class Main {
    private static byte[] digestOperation(String algo, byte[]... content) {
        try {/*from  ww  w  . j a  va2 s  .c o m*/
            MessageDigest messagedigest = MessageDigest.getInstance(algo);
            for (byte[] data : content) {
                messagedigest.update(data);
            }

            return messagedigest.digest();
        } catch (NoSuchAlgorithmException nosuchalgorithmexception) {
            nosuchalgorithmexception.printStackTrace();
            return null;
        }
    }
}

Related

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