function loginCredentials
loginCredentials(options: LoginCredentialsOptions): LoginCredentials

Derives the hashed credentials and the AES session key from a nonce.

Examples

Derive the session key

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

const { aesKey } = loginCredentials({
  username: "admin",
  password: "hunter2",
  nonce: "NONCE-0123",
});

assertEquals(new TextDecoder().decode(aesKey), "08822D7143979103");

Parameters

The user name, password and nonce.

Return Type

The hashes for loginXml and the AES key for the session.

Usage

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