Permalink
Browse files

解决了当传入参数为中文时候,Invalid signature的错误

  • Loading branch information...
1 parent 74429d9 commit a18a16803027662da7ff669eb17df5440d04c1e2 @Arnoldnuo Arnoldnuo committed Feb 8, 2014
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/helper.js
View
@@ -7,6 +7,6 @@ module.exports = {
function crypt(text, algo) {
text = String(text || '');
algo = algo || 'sha256';
-
- return crypto.createHash(algo).update(text).digest('hex');
+
+ return crypto.createHash(algo).update(new Buffer(text)).digest('hex');
}

0 comments on commit a18a168

Please sign in to comment.