MD5

public static void main(String[] args) throws NoSuchAlgorithmException {

    MessageDigest md = MessageDigest.getInstance("MD5");
    String pwd = "333";
    byte b1[] = pwd.getBytes();
    byte[] b2 = md.digest( b1 );
    BASE64Encoder en = new BASE64Encoder();
    String pwd2 = en.encode(b2);
    System.out.println(pwd2);

}

你可能感兴趣的:(java,java)