Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Module-friendly fork of [JavaScript MD5](https://github.com/blueimp/JavaScript-MD5). MD5 implementation. Compatible with server-side environments like Node.js, module loaders like RequireJS, Browserify or webpack and all web browsers.
JavaScript MD5 implementation. Compatible with server-side environments like Node.js, module loaders like RequireJS, Browserify or webpack and all web browsers.
Include the (minified) JavaScript MD5 script in your HTML markup:
<script src="js/md5.min.js"></script>
In your application code, calculate the (hex-encoded) MD5 hash of a string by calling the md5 method with the string as argument:
var hash = md5("value"); // "2063c1608d6e0baf80249c42e2be5804"
The following is an example how to use the JavaScript MD5 module on the server-side with Node.js.
Create a new directory and add the md5.js file. Or alternatively, install the blueimp-md5 package with npm:
npm install blueimp-md5
Add a file server.js with the following content:
require("http").createServer(function (req, res) {
// The md5 module exports the md5() function:
var md5 = require("./md5"),
// Use the following version if you installed the package with npm:
// var md5 = require("blueimp-md5"),
url = require("url"),
query = url.parse(req.url).query;
res.writeHead(200, {"Content-Type": "text/plain"});
// Calculate and print the MD5 hash of the url query:
res.end(md5(query));
}).listen(8080, "localhost");
console.log("Server running at http://localhost:8080/");
Run the application with the following command:
node server.js
The JavaScript MD5 script has zero dependencies.
Calculate the (hex-encoded) MD5 hash of a given string value:
var hash = md5("value"); // "2063c1608d6e0baf80249c42e2be5804"
Calculate the (hex-encoded) HMAC-MD5 hash of a given string value and key:
var hash = md5("value", "key"); // "01433efd5f16327ea4b31144572c67f6"
Calculate the raw MD5 hash of a given string value:
var hash = md5("value", null, true);
Calculate the raw HMAC-MD5 hash of a given string value and key:
var hash = md5("value", "key", true);
The JavaScript MD5 project comes with
Unit Tests.
There are two different ways to run the tests:
npm test
in the Terminal in the root path of the repository package.The first one tests the browser integration, the second one the node.js integration.
The JavaScript MD5 script is released under the MIT license.
FAQs
Module-friendly fork of [JavaScript MD5](https://github.com/blueimp/JavaScript-MD5). MD5 implementation. Compatible with server-side environments like Node.js, module loaders like RequireJS, Browserify or webpack and all web browsers.
The npm package es-md5 receives a total of 42 weekly downloads. As such, es-md5 popularity was classified as not popular.
We found that es-md5 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.