Toolbox-XToolbox-X

MD5 Generator

Computes an MD5 digest of the given string using a pure JavaScript implementation.

md5

The md5 function computes an MD5 digest of the given string using a pure JavaScript implementation.

Acknowledgement

This utility is highly inspired by the algorithm used in pure-md5 package.

Function Signature

md5(str: string): string

Parameters

ParameterTypeDescription
strstringInput text to hash.

Return Value

Returns the MD5 hash as a 32-character hexadecimal string.

Example Usage

playground.ts

Characteristics

  • Pure JavaScript implementation - runs on any JavaScript engine
  • Deterministic output - same input always produces same output
  • 32-character hex output - fixed length regardless of input size
  • One-way function - cannot be reversed to obtain original input

:::info Does not rely on Node.js or Web APIs. Works on any JS engine :::

Common Uses

  • Checksum verification
  • Data integrity checking
  • Non-cryptographic hashing
  • File fingerprinting
  • UUID v3 generation (combined with namespaces)

Security Note

MD5 is considered cryptographically broken and unsuitable for security-sensitive applications. Use stronger hashes like SHA-256 for security purposes.

Internal Usage

This function is used internally for UUID v3 generation:

// Used inside UUID v3
const digest = md5(namespace + name);

Last updated: Sun, Jun 14, 2026 08:22:19PM (UTC)

On this page