Android Utililty Methods SHA1 Hash Create

List of utility methods to do SHA1 Hash Create

Description

The list of methods to do SHA1 Hash Create are organized into topic(s).

Method

StringSHA1(String str)
SHA
return hash(str, "SHA-1");
Stringsha512(String what_to_encode)
sha
final MessageDigest sha512;
try {
    sha512 = MessageDigest.getInstance("SHA-512");
} catch (NoSuchAlgorithmException e) {
    return "404";
sha512.update(what_to_encode.getBytes());
byte byteData[] = sha512.digest();
...
StringSHA1(String text)
SHA
MessageDigest md = MessageDigest.getInstance("SHA-1");
byte[] sha1hash = new byte[40];
md.update(text.getBytes());
sha1hash = md.digest();
return convertToHex(sha1hash);
byte[]dataDigest(String in)
data Digest
if (in == null)
    return null;
MessageDigest md = MessageDigest.getInstance("SHA-1");
return md.digest(in.getBytes("UTF8"));
StringSHA1(String s)
SHA
if (s == null)
    return "";
try {
    MessageDigest md;
    md = MessageDigest.getInstance("SHA-1");
    byte[] sha1hash = new byte[40];
    md.update(s.getBytes("iso-8859-1"), 0, s.length());
    sha1hash = md.digest();
...
byte[]SHA1(String text)
SHA
MessageDigest md = MessageDigest.getInstance("SHA-1");
md.update(text.getBytes());
return md.digest();
byte[]SHA256(String text)
SHA
MessageDigest md = MessageDigest.getInstance("SHA-256");
md.update(text.getBytes());
return md.digest();
StringHashPassword(String text)
Calculates the hash value of the given password
MessageDigest md = MessageDigest.getInstance("SHA-1");
byte[] sha1hash = new byte[40];
byte[] data = text.getBytes("utf-8");
md.update(data, 0, data.length);
sha1hash = md.digest();
return convertToHex(sha1hash);
Stringsha1(File input)
sha
return hash(input, "SHA-1");
Stringsha1(String input)
sha
return hash(input, "SHA-1");