Skip to content

Commit 710a0f6

Browse files
authored
utf password md5 bug
fixes the bug described in http://stackoverflow.com/questions/33935749/node-js-postgres-utf-connect-string In short: utf password md5 generated is wrong because of binary encoding
1 parent 83a946f commit 710a0f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ Client.prototype.end = function(cb) {
344344
};
345345

346346
Client.md5 = function(string) {
347-
return crypto.createHash('md5').update(string).digest('hex');
347+
return crypto.createHash('md5').update(string, 'utf-8').digest('hex');
348348
};
349349

350350
// expose a Query constructor

0 commit comments

Comments
 (0)