md4

dumb MD4 digest calculation

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version 1.0.0
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:26

Tags

Authors

  • Mark Glines

Installation

nimble install md4
choosenim install md4
git clone https://github.com/infinoid/md4.nim

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
md4 - - - - - - -

Dependencies

Package Version Optional
nim >= 2.2.0 No

Source

Repository https://github.com/infinoid/md4.nim
Homepage https://github.com/infinoid/md4.nim
Registry Source nimble_official

README

MD4

This is a pure Nim implementation of MD4. It's mostly useful for compatibility with older MD4-based stuff, like ed2ksum.

The output is an array of 16 bytes. It operates on blocks of 64 bytes, buffering partial blocks as needed.

Disclaimers

  • MD4 is kinda old, and is NOT considered a secure cryptographic hash nowadays.
  • The unpredictability of its output should not be relied upon for security purposes.
  • This library makes no attempt to protect your data against side-channel attacks, or anything else, really.

Example

import md4

# hash a string (also accepts seq and openArray)
var ctx = NewMD4()
ctx.Update("message digest")
let result = ctx.Final()

import std/[sequtils, strutils]
let hexstr = map(result, proc(x: byte): string = toHex(x)).join
assert toLowerAscii(hexstr) == "d9130a8164549fe818874806e1c7014b"

License

MIT. Have fun!