Java Digest digest(String type, byte[] bytes)

Here you can find the source of digest(String type, byte[] bytes)

Description

digest

License

Open Source License

Declaration

private static byte[] digest(String type, byte[] bytes) 

Method Source Code


//package com.java2s;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class Main {

    private static byte[] digest(String type, byte[] bytes) {
        try {/*  w w w  .  j ava  2  s .c o  m*/
            MessageDigest dist = MessageDigest.getInstance(type);
            return dist.digest(bytes);
        } catch (NoSuchAlgorithmException e) {
            throw new IllegalArgumentException("Cannot find digest:" + type, e);
        }
    }
}

Related

  1. digest(String strSource)
  2. digest(String strSrc, String encName)
  3. digest(String text)
  4. digest(String text, String algorithm)
  5. digest(String token)
  6. digest(String uri)
  7. digest(String value, byte[] salt, int iterations)
  8. digest(String value, String algorithm)
  9. digestBased(String text)