Permalink
Browse files

remove hashlib dependence, use Crypto for hash.

  • Loading branch information...
1 parent 8446ed6 commit 16673d1b8056f729593f85c74b4d7d27f4196d3a @e6nian committed Jul 5, 2011
Showing with 4 additions and 5 deletions.
  1. +2 −2 lib/node-taobao.js
  2. +1 −2 package.json
  3. +1 −1 test/example.js
View
@@ -5,7 +5,7 @@
* MIT Licensed
*/
-var hashlib = require('hashlib')
+var crypto = require('crypto')
,request = require('request')
,dateFormat = require('dateformat')
,url = require('url')
@@ -64,7 +64,7 @@ Client.prototype.createSign = function(args) {
ss.push(self.appSecret);
var str = ss.join('');
// encode by md5
- var md5 = hashlib.md5(str);
+ var md5 = crypto.createHash('md5').update(str).digest('hex');
// upcase
return md5.toUpperCase();
};
View
@@ -1,12 +1,11 @@
{
"name": "node-taobao"
- , "version": "0.0.2"
+ , "version": "0.0.3"
, "description": "Library for taobao.com api"
, "keywords": ["taobao","top","taobao.com"]
, "homepage": "https://github.com/e6nian/node-taobao"
, "author": "e6nian <e6nian@gmail.com>"
, "dependencies": {
- "hashlib" : ">=1.0.0"
,"request" : ">=1.9.5"
,"dateformat" : ">=1.0.1-1.2.3"
}
View
@@ -1,6 +1,6 @@
var top = require('../lib/node-taobao')
,options = {'host':'gw.api.tbsandbox.com','appKey':'test','appSecret':'test'}
- ,params = {'method':'taobao.user.get','fields':'user_id,uid,sex','nick':'sandbox_c_1'}
+ ,params = {'method':'taobao.user.get','fields':'user_id,uid,sex,location','nick':'sandbox_c_1'}
;

0 comments on commit 16673d1

Please sign in to comment.