public function hash(Password $password, $username, $domain_name)
    {
        $nt_v1_hash = $this->nt_v1_hasher->hash($password);

        $hmac_hasher = $this->keyed_hasher_factory->build(
            static::EXPECTED_HASHER_ALGORITHM,
            $nt_v1_hash->getValue() // Make sure the key is the binary string
        );

        $data_to_hash = $this->encoding_converter->convert(
            (strtoupper($username) . $domain_name),
            static::HASH_SOURCE_ENCODING
        );

        $binary_hash = $hmac_hasher->update($data_to_hash)->digest();

        return Hash::fromBinaryString($binary_hash, HashType::NT_V2);
    }
public function hash(Password $password, $username, $domain_name)
    {
        $nt_v1_hash = $this->nt_v1_hasher->hash($password);

        $hmac_hasher = $this->keyed_hasher_factory->build(
            static::EXPECTED_HASHER_ALGORITHM,
            $nt_v1_hash->getValue() // Make sure the key is the binary string
        );

        $data_to_hash = $this->encoding_converter->convert(
            (strtoupper($username) . $domain_name),
            static::HASH_SOURCE_ENCODING
        );

        $binary_hash = $hmac_hasher->update($data_to_hash)->digest();

        return Hash::fromBinaryString($binary_hash, HashType::NT_V2);
    }
{@inheritDoc}