function md5Modern
md5Modern(text: string): string

Hashes a string the way Baichuan's modern login does: MD5 of the UTF-8 bytes, as upper-case hex, with the last hex digit dropped (31 characters).

Examples

Hash a string

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

assertEquals(md5Modern(""), "D41D8CD98F00B204E9800998ECF8427");

Parameters

text: string

The string to hash.

Return Type

string

The 31-character upper-case hex digest.

Usage

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