Comparing version 7.0.23 to 7.0.24
@@ -47,2 +47,4 @@ "use strict"; | ||
var _browserOrNode = require("browser-or-node"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -65,8 +67,8 @@ | ||
*/ | ||
var Crypto = require('crypto'); | ||
var Crypto = require('crypto-browserify'); | ||
var ipaddr = require('ipaddr.js'); // Returns a wrapper function that will promisify a given callback function. | ||
var ipaddr = require('ipaddr.js'); | ||
// Returns a wrapper function that will promisify a given callback function. | ||
// It will preserve 'this'. | ||
function promisify(fn) { | ||
@@ -450,3 +452,3 @@ return function () { | ||
var objectToBuffer = function objectToBuffer(payload) { | ||
var payloadBuf = Buffer.from(Buffer.from(JSON.stringify(payload))); | ||
var payloadBuf = Buffer.from(Buffer.from(payload)); | ||
return payloadBuf; | ||
@@ -456,3 +458,7 @@ }; | ||
var toMd5 = function toMd5(payload) { | ||
return Crypto.createHash('md5').update(objectToBuffer(payload)).digest().toString('base64'); | ||
var payLoadBuf = objectToBuffer(payload); // use string from browser and buffer from nodejs | ||
// browser support is tested only against minio server | ||
payLoadBuf = _browserOrNode.isBrowser ? payLoadBuf.toString() : payLoadBuf; | ||
return Crypto.createHash('md5').update(payLoadBuf).digest().toString('base64'); | ||
}; | ||
@@ -459,0 +465,0 @@ |
{ | ||
"name": "minio", | ||
"version": "7.0.23", | ||
"version": "7.0.24", | ||
"description": "S3 Compatible Cloud Storage client", | ||
@@ -37,2 +37,3 @@ "main": "./dist/main/minio.js", | ||
"block-stream2": "^2.0.0", | ||
"browser-or-node": "^1.3.0", | ||
"es6-error": "^4.1.1", | ||
@@ -39,0 +40,0 @@ "fast-xml-parser": "^3.17.5", |
Sorry, the diff of this file is too big to display
285348
5646
15
+ Addedbrowser-or-node@^1.3.0
+ Addedbrowser-or-node@1.3.0(transitive)