code: def generate_authenticator_response(password, nt_response, peer_challenge, authenticator_challenge, username):
      
      Magic1 = "\x4D\x61\x67\x69\x63\x20\x73\x65\x72\x76\x65\x72\x20\x74\x6F\x20\x63\x6C\x69\x65\x6E\x74\x20\x73\x69\x67\x6E\x69\x6E\x67\x20\x63\x6F\x6E\x73\x74\x61\x6E\x74"
      Magic2 = "\x50\x61\x64\x20\x74\x6F\x20\x6D\x61\x6B\x65\x20\x69\x74\x20\x64\x6F\x20\x6D\x6F\x72\x65\x20\x74\x68\x61\x6E\x20\x6F\x6E\x65\x20\x69\x74\x65\x72\x61\x74\x69\x6F\x6E"
      password_hash = nt_password_hash(password)
      password_hash_hash = hash_nt_password_hash(password_hash)
  
      sha_hash = hashlib.sha1()
      sha_hash.update(password_hash_hash)
      sha_hash.update(nt_response)
      sha_hash.update(Magic1)
      digest = sha_hash.digest()
  
      challenge = challenge_hash(peer_challenge, authenticator_challenge, username)
  
      sha_hash = hashlib.sha1()
      sha_hash.update(digest)
      sha_hash.update(challenge)
      sha_hash.update(Magic2)
      digest = sha_hash.digest()
  
      return "\x01S=" + convert_to_hex_string(digest)
docs: GenerateAuthenticatorResponse