您的位置:首页 > 编程语言 > Java开发

MD5Encoding编码工具类

2016-07-27 16:41 393 查看
需要在pom.xml文件中导入:

      <dependency>

            <groupId>org.apache.httpcomponents</groupId>

            <artifactId>httpclient</artifactId>

            <version>4.3.5</version>

        </dependency>

该JAR包的作用是用于使用:org.apache.commons.codec.digest.DigestUtils;

import java.io.UnsupportedEncodingException;

import org.apache.commons.codec.digest.DigestUtils;

/**

 * 编解码工具。

 *

 */

public class EncodingUtils {

    public static String md5StringWithUTF8(String content) throws UnsupportedEncodingException{

        return DigestUtils.md5Hex(content.getBytes("UTF8"));

    }

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  java