package com.friday.custody.service.trustService.guosen.utils;

import org.springframework.util.DigestUtils;

import java.util.Locale;
import java.util.concurrent.locks.ReentrantLock;

public class MD5Util {
    private static ReentrantLock reentrantLock = new ReentrantLock();

    public static String getMD5Str(String str) {
        reentrantLock.lock();
        try {
            return DigestUtils.md5DigestAsHex(str.getBytes()).toUpperCase(Locale.ROOT);
        }finally {
            reentrantLock.unlock();
        }
    }
}
