文档解析应用
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
694 B

6 months ago
  1. package com.bfd.parse.utils;
  2. import java.security.MessageDigest;
  3. /**
  4. * 其他工具类
  5. * @author jian.mao
  6. * @date 2023年9月19日
  7. * @description
  8. */
  9. public class OtherUtils {
  10. public static String getMd5(String string) {
  11. try {
  12. MessageDigest md5 = MessageDigest.getInstance("MD5");
  13. byte[] bs = md5.digest(string.getBytes("UTF-8"));
  14. StringBuilder sb = new StringBuilder(40);
  15. for (byte x : bs) {
  16. if ((x & 0xff) >> 4 == 0) {
  17. sb.append("0").append(Integer.toHexString(x & 0xff));
  18. } else {
  19. sb.append(Integer.toHexString(x & 0xff));
  20. }
  21. }
  22. return sb.toString();
  23. } catch (Exception e) {
  24. return "nceaform" + System.currentTimeMillis();
  25. }
  26. }
  27. }