private static byte[] ntlmv2Hash(final String domain, final String user, final byte[] ntlmHash) {
        final HMACMD5 hmacMD5 = new HMACMD5(ntlmHash);
        // Upper case username, mixed case target!!
        hmacMD5.update(user.toUpperCase(Locale.ROOT).getBytes(UNICODE_LITTLE_UNMARKED));
        if (domain != null) {
            hmacMD5.update(domain.getBytes(UNICODE_LITTLE_UNMARKED));
        }
        return hmacMD5.getOutput();
    }
Creates the NTLMv2 Hash of the user's password.

@return The NTLMv2 Hash, used in the calculation of the NTLMv2 and LMv2
        Responses.
httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/NTLMEngineImpl.java