static byte[] createCnonce(final DigestAlgorithm algorithm) {
        final SecureRandom rnd = new SecureRandom();
        final int length;
        switch (algorithm.name().toUpperCase()) {
            case "SHA-256":
            case "SHA-512/256":
                length = 32;
                break;
            case "MD5":
            default:
                length = 16;
                break;
        }
        final byte[] tmp = new byte[length];
        rnd.nextBytes(tmp);
        return tmp;
    }
Creates a random cnonce value based on the specified algorithm's expected entropy.
Adjusts the length of the byte array based on the algorithm to ensure sufficient entropy.

@param algorithm the algorithm for which the cnonce is being generated (e.g., "MD5", "SHA-256", "SHA-512-256").
@return The cnonce value as a byte array.
@since 5.5
httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/DigestScheme.java