public static String getSHAString(String source) {
        if (source == null) {
            return null;
        }

        String retString = null;
        try {
            MessageDigest md = MessageDigest.getInstance(ALGORITHM_NAME);
            md.update(source.getBytes(), 0, source.length());
            byte[] retBytes = md.digest();

            StringBuilder sb = new StringBuilder();
            for (byte b : retBytes) {
                sb.append(hexDigits[(b >> 4) & 0x0f]);
                sb.append(hexDigits[b & 0x0f]);
            }

            retString = sb.toString();
        } catch (NoSuchAlgorithmException e) {
            log.error("" + e);
        }

        return retString;
    }
Get SHA from the given string.

@param source string to be encrypted
@return SHA string after encrypt
inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/util/SHAUtils.java