Generate a consistent fingerprint for any string to use as a cache key in your web app.
Check whether a downloaded file has been tampered with by comparing its MD5 hash to an expected value.
Create deduplication identifiers for user-submitted content before storing it in a database.
JavaScript-MD5 is a small JavaScript library that computes MD5 hashes. MD5 is a mathematical function that takes any input text and produces a short fixed-length string of characters, called a hash or checksum. For example, the text "value" always produces the same 32-character result. If even one character in the input changes, the hash changes completely. This property makes MD5 useful for detecting whether a file or piece of data has been modified. The library exposes a single function: pass it a string, and it returns the MD5 hash as a hexadecimal string. It also supports HMAC-MD5, which is a variant that takes both a value and a secret key, producing a hash that depends on both inputs. You can also request the raw binary hash instead of the default hex string. The library has zero dependencies and works in web browsers, in Node.js on the server side, and with module bundlers like webpack or RequireJS. Including it in a browser project is as simple as adding a script tag, in a Node.js project, a standard require call is sufficient. Installation from npm uses the package name blueimp-md5. MD5 is not recommended for security-sensitive work like password storage because it has known weaknesses. This library is suitable for checksums, cache keys, deduplication identifiers, or other situations where a fast, consistent hash of a string is needed without security requirements. The project includes unit tests that can be run in the browser by opening a test HTML file, or from the command line using npm test.
← blueimp on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.