Android Hash Code Calculate hash(String password)

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

Description

hash

Declaration

private static byte[] hash(String password) 

Method Source Code

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

public class Main {
    private static byte[] hash(String password) {

        MessageDigest digest = null;
        try {/*w  w w  .  java2 s.c  o m*/
            // MD5-128
            digest = java.security.MessageDigest.getInstance("MD5");
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        }

        digest.update(password.getBytes());
        byte messageDigest[] = digest.digest();
        return messageDigest;

    }
}

Related

  1. hash(File file, String algorithm)
  2. hash(String input, String algorithm)
  3. hash(String s, String algorithm)
  4. hash(char[] pin, byte[] salt)
  5. hash(int seed, Object o)
  6. hash(int seed, boolean x)