blueimp-md5 is a pure JavaScript implementation of the MD5 (Message-Digest Algorithm 5) cryptographic hash function. It is compatible with a wide range of environments, including server-side Node.js applications, client-side web browsers, and module loaders such as RequireJS, Browserify, and webpack. The current stable version is 2.19.0. This library is lightweight with zero external dependencies, making it a self-contained utility for generating MD5 hashes. While highly performant for its purpose, it's crucial to note that MD5 is considered cryptographically broken and should not be used for security-sensitive applications like password hashing or digital signatures, where collisions could be exploited. Its typical use cases include data integrity checks or unique ID generation in non-security contexts.
npm install blueimp-md5Verified import paths — ran on the pinned version, not inferred.
Demonstrates calculating hex-encoded MD5 hashes, HMAC-MD5 hashes with a key, and raw MD5 outputs for a given string, showing typical API usage.
For security-sensitive applications, migrate to algorithms like SHA-256 (e.g., Node.js `crypto` module) or bcrypt (for passwords).
Always check the third argument when using `md5()`. If `true`, handle the output as a raw byte string. Convert it to hex if needed, e.g., `md5('value', null, true).split('').map(c => c.charCodeAt(0).toString(16).padStart(2, '0')).join('')`.When using multiple scripts, be mindful of global namespace pollution. Consider using module bundlers like webpack or Browserify to encapsulate dependencies and avoid global variable conflicts.
In browsers, ensure `<script src="md5.min.js"></script>` is present before `md5()` is called. In CommonJS, use `const md5 = require('blueimp-md5')`. In ESM, use `import md5 from 'blueimp-md5'`.For ESM, use `import md5 from 'blueimp-md5'`. For CommonJS, use `const md5 = require('blueimp-md5')`.For browser use, either include the library directly via a `<script>` tag or use a module bundler that processes CommonJS `require` statements.
No dependency data recorded yet.