diff --git a/lib/protocol/Auth.js b/lib/protocol/Auth.js index 0b95ab845..e0dcdce2a 100644 --- a/lib/protocol/Auth.js +++ b/lib/protocol/Auth.js @@ -3,10 +3,9 @@ var Crypto = require('crypto'); var Auth = exports; var sha1; -if (Number(process.version.match(/^v\d+\.(\d+)/)[1]) >= 10){ +if (typeof Crypto.createHash.write == 'function') { sha1 = function(msg) { var hash = Crypto.createHash('sha1'); - hash.setEncoding('binary'); hash.write(msg); hash.end(); return hash.read();