site.sorghum.anno._common.util.MD5Util Maven / Gradle / Ivy
The newest version!
package site.sorghum.anno._common.util;
import cn.hutool.crypto.digest.MD5;
import java.io.File;
/**
* MD5工具类
* @author Sorghum
* @since 2023/06/30
*/
public class MD5Util {
/**
* Md5实例
*/
private final static ThreadLocal MD5_INSTANCE = ThreadLocal.withInitial(MD5::create);
public static String digestHex(String str) {
return MD5_INSTANCE.get().digestHex(str);
}
public static String digestHex(File file) {
return MD5_INSTANCE.get().digestHex(file);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy