[Pkg-javascript-commits] [node-shasum] 07/23: assum utf-8

Bastien Roucariès rouca at moszumanska.debian.org
Fri May 5 09:06:23 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-shasum.

commit db3cf00107c5e4c0d5d562e32ccf7f993508bb2f
Author: Dominic Tarr <dominic.tarr at gmail.com>
Date:   Wed Jun 12 18:26:15 2013 +0200

    assum utf-8
---
 index.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/index.js b/index.js
index a41388c..989651f 100644
--- a/index.js
+++ b/index.js
@@ -5,6 +5,7 @@ module.exports = function hash (str, alg, format) {
   str = 'string' === typeof str ? str
     : Buffer.isBuffer(str) ? str
     : JSON.stringify(str)
-  return createHash(alg || 'sha1').update(str).digest(format || 'hex')
+  return createHash(alg || 'sha1')
+    .update(str, Buffer.isBuffer(str) ? null : 'utf8').digest(format || 'hex')
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-shasum.git



More information about the Pkg-javascript-commits mailing list