private static DigestAlgorithm fromString(final String algorithm) {
            switch (algorithm.toUpperCase(Locale.ROOT)) {
                case "MD5":
                    return MD5;
                case "MD5-SESS":
                    return MD5_SESS;
                case "SHA-256":
                    return SHA_256;
                case "SHA-256-SESS":
                    return SHA_256_SESS;
                case "SHA-512/256":
                case "SHA-512-256":
                    return SHA_512_256;
                case "SHA-512-256-SESS":
                    return SHA_512_256_SESS;
                default:
                    throw new UnsupportedDigestAlgorithmException("Unsupported digest algorithm: " + algorithm);
            }
        }
Maps a string representation of an algorithm to the corresponding enum constant.

@param algorithm the algorithm name, e.g., "SHA-256" or "SHA-512-256-sess"
@return the corresponding {@code DigestAlgorithm} constant
@throws UnsupportedDigestAlgorithmException if the algorithm is unsupported
httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/DigestScheme.java