js-md4 is a JavaScript library providing a pure JavaScript implementation of the MD4 cryptographic hash function. Currently at version 0.3.2, its last known release was over eight years ago, indicating it is an abandoned project with no ongoing maintenance or updates. The library supports UTF-8 encoding for input strings and can process various data types, including JavaScript strings, raw byte `Array`s, `Uint8Array`s, and `ArrayBuffer`s. It offers both a direct hashing function for immediate results and an incremental hashing API via a `create()` method, allowing for data to be fed in chunks. Output formats include hexadecimal strings, byte arrays, and ArrayBuffers. Key differentiators at the time of its release were its pure JavaScript nature, broad browser compatibility (via script tag and AMD), and Node.js support (via CommonJS). Given the long period of inactivity and the known cryptographic weaknesses of MD4 itself, this library is primarily suitable for compatibility with legacy systems or non-security-critical hashing tasks.
npm install js-md4Verified import paths — ran on the pinned version, not inferred.
Demonstrates both direct and incremental MD4 hashing with various input and output types, including UTF-8 strings.
Migrate to a cryptographically secure hash function such as SHA-256 or SHA-3 (e.g., using Node.js's `crypto` module or a modern library like `noble-hashes`).
Use `arrayBuffer()` instead of `buffer()` to retrieve the hash as an ArrayBuffer.
For new projects, avoid this library entirely. For existing projects, evaluate the risk of using unmaintained code and consider replacing it with a current alternative, especially if MD4 is used for non-cryptographic purposes that require ongoing reliability.
For ESM projects, use a bundler (e.g., Webpack, Rollup, Parcel) that can handle CommonJS modules, or continue to use `require()` in Node.js where appropriate.
In browsers, ensure `<script src="path/to/md4.min.js"></script>` is included. In Node.js, use `const md4 = require('js-md4');`.Replace `hash.buffer()` with `hash.arrayBuffer()`.
For browsers, use the global `md4` object after loading the script via a `<script>` tag. For ESM in Node.js, this library is not directly compatible; consider a bundler or an alternative library.
No dependency data recorded yet.