Socket
Socket
Sign inDemoInstall

stream-md5

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.1 to 0.0.2

.npmignore

25

md5.js

@@ -15,3 +15,4 @@ /*

var HAS_BUFFERS = (typeof 'Buffer' !== 'undefined'),
var HAS_BUFFERS = (typeof Buffer !== 'undefined'),
HAS_UINT8ARRAY = (typeof Uint8Array !== 'undefined')
undefined;

@@ -34,2 +35,17 @@

if (HAS_UINT8ARRAY) {
function uint8ArraySubstring(uint8Array, start, end) {
return uint8Array.subarray(start, end);
}
function uint8ArrayConcat(uint8Array1, uint8Array2) {
if (uint8Array1 === null) {
return uint8Array2;
}
var tmp = new Uint8Array(uint8Array1.length + uint8Array2.length);
tmp.set(uint8Array1, 0);
tmp.set(uint8Array2, uint8Array1.length);
return tmp;
}
}
function stringCharCodeAt(string, offset) {

@@ -184,2 +200,6 @@ return string.charCodeAt(offset);

concat = arrayConcat;
} else if (HAS_UINT8ARRAY && (s instanceof Uint8Array)) {
substring = uint8ArraySubstring;
charCodeAt = arrayCharCodeAt;
concat = uint8ArrayConcat;
} else {

@@ -230,2 +250,5 @@ substring = stringSubstring;

}
} else if (HAS_UINT8ARRAY && (s instanceof Uint8Array)) {
substring = uint8ArraySubstring;
charCodeAt = arrayCharCodeAt;
} else {

@@ -232,0 +255,0 @@ substring = stringSubstring;

4

package.json
{
"name": "stream-md5",
"version": "0.0.1",
"version": "0.0.2",
"description": "MD5 implementation in JS that allows progressive hashing and is binary safe",

@@ -26,2 +26,2 @@ "main": "jsMD5.js",

"readmeFilename": "README.md"
}
}

@@ -44,2 +44,8 @@ var fs = require('fs'),

exports.helloUint8Array = function(test) {
var hash = StreamMD5.hash(new Uint8Array([c('h'), c('e'), c('l'), c('l'), c('o')]));
test.equal(hash, '5d41402abc4b2a76b9719d911017c592');
test.done();
};
exports.helloStreaming = function(test) {

@@ -46,0 +52,0 @@ var state = StreamMD5.init(),

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc