function loginXml
loginXml(credentials: Pick<LoginCredentials, "userHash" | "passwordHash">): string

Builds the XML body of the login request.

Examples

Build the login body

import { assertStringIncludes } from "@std/assert";
import { loginXml } from "@hertzg/reolink-api/protocol/login";

const xml = loginXml({ userHash: "USER", passwordHash: "PASS" });

assertStringIncludes(xml, "<userName>USER</userName>");
assertStringIncludes(xml, "<password>PASS</password>");

Parameters

credentials: Pick<LoginCredentials, "userHash" | "passwordHash">

The hashes from loginCredentials.

Return Type

string

The login XML, ready to be XOR-encrypted.

Usage

import { loginXml } from "protocol/login.ts";