Socket
Socket
Sign inDemoInstall

md5-file

Package Overview
Dependencies
0
Maintainers
2
Versions
29
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.2.3 to 4.0.0

19

index.js
'use strict'
var crypto = require('crypto')
var fs = require('fs')
var alloc = require('buffer-alloc')
const crypto = require('crypto')
const fs = require('fs')
var BUFFER_SIZE = 8192
const BUFFER_SIZE = 8192
function md5FileSync (filename) {
var fd = fs.openSync(filename, 'r')
var hash = crypto.createHash('md5')
var buffer = alloc(BUFFER_SIZE)
const fd = fs.openSync(filename, 'r')
const hash = crypto.createHash('md5')
const buffer = Buffer.alloc(BUFFER_SIZE)
try {
var bytesRead
let bytesRead

@@ -31,4 +30,4 @@ do {

var output = crypto.createHash('md5')
var input = fs.createReadStream(filename)
const output = crypto.createHash('md5')
const input = fs.createReadStream(filename)

@@ -35,0 +34,0 @@ input.on('error', function (err) {

@@ -10,3 +10,3 @@ {

],
"version": "3.2.3",
"version": "4.0.0",
"description": "return an md5sum of a given file",

@@ -28,11 +28,8 @@ "keywords": [

"devDependencies": {
"mocha": "^2.4.5",
"standard": "^7.1.0"
"mocha": "^5.0.5",
"standard": "^11.0.1"
},
"engines": {
"node": ">=0.10"
},
"dependencies": {
"buffer-alloc": "^1.1.0"
"node": ">=6.0"
}
}
'use strict'
var md5File = require('./')
const md5File = require('./')

@@ -5,0 +5,0 @@ function md5FileAsPromised (filename) {

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