Skip to content
Browse files

replaced hashlib with node's crypto module.

  • Loading branch information...
1 parent b2a618b commit 3b01b0bdf68b8b173cc22b6ee8d0927428719123 @teemow committed
Showing with 5 additions and 6 deletions.
  1. +1 −2 README.md
  2. +4 −4 lib/flickr.js
View
3 README.md
@@ -28,5 +28,4 @@ flickr.connect(options, function(err, api) {
## Dependencies
-If you need to use signed methods you have to install hashlib:
-<http://github.com/brainfucker/hashlib>
+If you need to use signed methods you have to install node with openssl.
View
8 lib/flickr.js
@@ -1,8 +1,6 @@
/**
* Flickr api client for node.js
- *
* inspired by node-flickr (http://github.com/edds/node-flickr/)
- *
* works on flickrs reflection api
*
* created by Timo Derstappen (http://teemow.com/)
@@ -12,7 +10,7 @@ var http = require('http'),
sys = require('sys'),
path = require('path'),
fs = require('fs'),
- hashlib = require('hashlib');
+ crypto = require('crypto');
var api = {};
var api_key = '';
@@ -48,7 +46,9 @@ function getUrl(method, sign_required, auth_required, args) {
* Create a signature for flickr api requests
*/
function getSignature(params) {
- return hashlib.md5(secret + params.sort().join().replace(/(=|,)/g, ''));
+ var hash = crypto.createHash('md5');
+ hash.update(secret + params.sort().join().replace(/(=|,)/g, ''));
+ return hash.digest('hex');
}
function cacheExists(callback) {

0 comments on commit 3b01b0b

Please sign in to comment.
Something went wrong with that request. Please try again.