Skip to content

Commit c3704f3

Browse files
committed
(apache#5102) - specify md5 data encoding
The default encoding was switched to utf8 in nodejs/node#5522
1 parent b2895aa commit c3704f3

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/deps/md5.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import toPromise from './toPromise';
22
import crypto from 'crypto';
33

44
var res = toPromise(function (data, callback) {
5-
var base64 = crypto.createHash('md5').update(data).digest('base64');
5+
var base64 = crypto.createHash('md5').update(data, 'binary').digest('base64');
66
callback(null, base64);
77
});
88

9-
export default res;
9+
export default res;

src/mapreduce/md5.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import crypto from 'crypto';
22

33
function MD5(string) {
4-
return crypto.createHash('md5').update(string).digest('hex');
4+
return crypto.createHash('md5').update(string, 'binary').digest('hex');
55
}
66

7-
export default MD5;
7+
export default MD5;

0 commit comments

Comments
 (0)