Java MD5 String md5(String content)

Here you can find the source of md5(String content)

Description

md

License

Open Source License

Declaration

public static String md5(String content) throws UnsupportedEncodingException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;

import sun.misc.BASE64Encoder;

public class Main {
    private static MessageDigest md5;
    private static BASE64Encoder base64en = new BASE64Encoder();

    public static String md5(String content) throws UnsupportedEncodingException {
        return base64en.encode(md5.digest(content.getBytes("utf-8")));

    }/*from w w  w  .  j  a  v a2  s . com*/
}

Related

  1. md5(java.lang.String message)
  2. md5(Object content)
  3. md5(Path path)
  4. md5(String content)
  5. md5(String content)
  6. md5(String d)
  7. md5(String data)
  8. md5(String data)
  9. md5(String data)