Module: crypto.md5

Source: ./crypto/md5.reef


Overview

crypto/md5 - MD5 message-digest algorithm

Implements MD5 (RFC 1321) hash function. Produces 128-bit (16-byte) digest.

Usage: import crypto.md5 let hash = md5("Hello, World!") // Returns 32-char hex string let hash = md5_hex("Hello, World!") // Same as md5()


Functions

fn md5_k(i: int): int

Get K constant for round i (0-63) T[i] = floor(2^32 * abs(sin(i+1)))

fn md5_s(i: int): int

Get shift amount for round i (0-63)

fn md5_f(x: int, y: int, z: int): int

fn md5_g(x: int, y: int, z: int): int

fn md5_h(x: int, y: int, z: int): int

fn md5_i(x: int, y: int, z: int): int

fn md5(data: string): string

fn md5_hex(data: string): string

fn md5_hex_lower(data: string): string

fn md5_bytes(data: [uint8]): string

MD5 for binary data (byte arrays) - handles null bytes correctly

fn md5_hex_digits(): string

fn md5_state_to_hex(state: [int]): string

Convert MD5 state to 32-char hex string (little-endian byte order)


Procedures

proc md5_process_block(state: [int], block: [int])


Generated by reefc doc