From c3704f3e4049dd9571a576556f7bccb2c3f26dd2 Mon Sep 17 00:00:00 2001 From: Owen Smith Date: Fri, 29 Apr 2016 08:33:27 -0400 Subject: [PATCH] (#5102) - specify md5 data encoding The default encoding was switched to utf8 in nodejs/node#5522 --- src/deps/md5.js | 4 ++-- src/mapreduce/md5.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/deps/md5.js b/src/deps/md5.js index 664600453a..7a69e26f4c 100644 --- a/src/deps/md5.js +++ b/src/deps/md5.js @@ -2,8 +2,8 @@ import toPromise from './toPromise'; import crypto from 'crypto'; var res = toPromise(function (data, callback) { - var base64 = crypto.createHash('md5').update(data).digest('base64'); + var base64 = crypto.createHash('md5').update(data, 'binary').digest('base64'); callback(null, base64); }); -export default res; \ No newline at end of file +export default res; diff --git a/src/mapreduce/md5.js b/src/mapreduce/md5.js index 182fdc87f7..8db57f3d35 100644 --- a/src/mapreduce/md5.js +++ b/src/mapreduce/md5.js @@ -1,7 +1,7 @@ import crypto from 'crypto'; function MD5(string) { - return crypto.createHash('md5').update(string).digest('hex'); + return crypto.createHash('md5').update(string, 'binary').digest('hex'); } -export default MD5; \ No newline at end of file +export default MD5;