Java Hash Calculate getHash(String strDate)

Here you can find the source of getHash(String strDate)

Description

get Hash

License

Open Source License

Declaration

public static byte[] getHash(String strDate) throws Exception 

Method Source Code


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

public class Main {
    public static byte[] getHash(String strDate) throws Exception {
        byte[] strDateByte = strDate.getBytes();
        MessageDigest md = MessageDigest.getInstance("SHA-1");
        md.update(strDateByte, 0, strDateByte.length);
        return md.digest();
    }/*w ww  . j  av  a  2 s .c o m*/

    public static byte[] getHash(byte[] strDate) throws Exception {
        MessageDigest md = MessageDigest.getInstance("SHA-1");
        md.update(strDate, 0, strDate.length);
        return md.digest();
    }
}

Related

  1. getHash(String password, String salt)
  2. getHash(String password, String salt)
  3. getHash(String phrase, String algorithm)
  4. getHash(String s)
  5. getHash(String str, String algorithm)
  6. getHash(String text)
  7. getHash(String valueToHash)
  8. getHash(String var)
  9. getHashChars(byte[] bytes)