编程知识 cdmana.com

Java:org.apache.commons.codec.digest.DigestUtils计算MD5值

依赖

<dependency>
    <groupId>commons-codec</groupId>
    <artifactId>commons-codec</artifactId>
    <version>1.10</version>
</dependency>

计算MD5值

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

public class CodeDemo {
    
    public static void main(String[] args) {
    
        System.out.println(DigestUtils.md5Hex("hello"));
        // 5d41402abc4b2a76b9719d911017c592
    }
}

版权声明
本文为[彭世瑜]所创,转载请带上原文链接,感谢
https://pengshiyu.blog.csdn.net/article/details/111596555

Scroll to Top