Android SHA1 Hash Create computeSHAHash(String password)

Here you can find the source of computeSHAHash(String password)

Description

compute SHA Hash

Declaration

public static String computeSHAHash(String password) 

Method Source Code

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

public class Main {
    public static String computeSHAHash(String password) {
        MessageDigest digest = null;
        try {//from  w w  w.  j av a2 s . com
            digest = MessageDigest.getInstance("SHA-1");
        } catch (Exception e) {
            e.printStackTrace();
        }
        digest.reset();
        byte[] data = digest.digest(password.getBytes());
        return String.format("%0" + (data.length * 2) + "X",
                new BigInteger(1, data));
    }
}

Related

  1. sha1(String ori)
  2. sha1(String ori)
  3. sha1(String s)
  4. sha1(String s)
  5. computeHashSHA1(final String text)
  6. getSHA1CertFingerprint(Context ctx)
  7. SHA1(String text)
  8. shaByte(String in)
  9. shaByte(byte[] in)