Skip to content

Commit

Permalink
(pouchdb#5102) - specify md5 data encoding
Browse files Browse the repository at this point in the history
The default encoding was switched to utf8 in nodejs/node#5522
  • Loading branch information
omsmith committed Apr 29, 2016
1 parent b2895aa commit c3704f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/deps/md5.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
export default res;
4 changes: 2 additions & 2 deletions src/mapreduce/md5.js
Original file line number Diff line number Diff line change
@@ -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;
export default MD5;

0 comments on commit c3704f3

Please sign in to comment.