Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

md5

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

md5 - npm Package Compare versions

Comparing version 2.2.1 to 2.3.0

demo/index.html

2

md5.js

@@ -17,3 +17,3 @@ (function(){

message = Array.prototype.slice.call(message, 0);
else if (!Array.isArray(message))
else if (!Array.isArray(message) && message.constructor !== Uint8Array)
message = message.toString();

@@ -20,0 +20,0 @@ // else, assume byte array already

{
"name": "md5",
"description": "js function for hashing messages with MD5",
"version": "2.2.1",
"version": "2.3.0",
"author": "Paul Vorbach <paul@vorba.ch> (http://paul.vorba.ch)",

@@ -24,11 +24,13 @@ "contributors": [

"scripts": {
"test": "mocha"
"test": "mocha",
"webpack": "webpack -p"
},
"dependencies": {
"charenc": "~0.0.1",
"crypt": "~0.0.1",
"is-buffer": "~1.1.1"
"charenc": "0.0.2",
"crypt": "0.0.2",
"is-buffer": "~1.1.6"
},
"devDependencies": {
"mocha": "~2.3.4"
"mocha": "~2.3.4",
"webpack": "~2.4.1"
},

@@ -35,0 +37,0 @@ "optionalDependencies": {},

# MD5
[![build status](https://secure.travis-ci.org/pvorb/node-md5.png)](http://travis-ci.org/pvorb/node-md5)
[![build status](https://secure.travis-ci.org/pvorb/node-md5.png)](http://travis-ci.org/pvorb/node-md5) [![info badge](https://img.shields.io/npm/dt/md5.svg)](http://npm-stat.com/charts.html?package=md5)
a JavaScript function for hashing messages with MD5.
node-md5 is being sponsored by the following tool; please help to support us by taking a look and signing up to a free trial
<a href="https://tracking.gitads.io/?repo=node-md5"><img src="https://images.gitads.io/node-md5" alt="GitAds"/></a>
## Installation

@@ -24,3 +27,3 @@

* `message` -- `String` or `Buffer`
* `message` -- `String`, `Buffer`, `Array` or `Uint8Array`
* returns `String`

@@ -27,0 +30,0 @@

@@ -6,3 +6,3 @@ var md5 = require('./md5.js');

it('should throw an error for `undefined`', function() {
it('should throw an error for an undefined value', function() {
assert.throws(function() {

@@ -13,2 +13,6 @@ md5(undefined);

it('should allow the hashing of the string `undefined`', function() {
assert.equal('5e543256c480ac577d30f76f9120eb74', md5('undefined'));
});
it('should throw an error for `null`', function() {

@@ -47,2 +51,28 @@ assert.throws(function() {

});
it('should support Uint8Array', function() {
// Polyfills
if (!Array.from) {
Array.from = function(src, fn) {
var result = new Array(src.length);
for (var i = 0; i < src.length; ++i)
result[i] = fn(src[i]);
return result;
};
}
if (!Uint8Array.from) {
Uint8Array.from = function(src) {
var result = new Uint8Array(src.length);
for (var i = 0; i < src.length; ++i)
result[i] = src[i];
return result;
};
}
var message = 'foobarbaz';
var u8arr = Uint8Array.from(
Array.from(message, function(c) { return c.charCodeAt(0); }));
var u8aHash = md5(u8arr);
assert.equal(u8aHash, md5(message));
});
});

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc