Skip to content

weixin-ts / cdn/src / md5Hex

Function: md5Hex()

md5Hex(data): Promise<string>

Defined in: cdn/src/utils.ts:17

Compute MD5 hash of a buffer. Uses WebCrypto digest API (available in Node.js 18+, browsers, Deno, Bun).

Note: MD5 is used here only for file integrity checks (matching the Weixin protocol), not for security purposes.

Parameters

data

ArrayBuffer | Uint8Array<ArrayBufferLike>

Data to hash

Returns

Promise<string>

Hex-encoded MD5 string

Released under the MIT License.