diff --git a/index.js b/index.js index b69c691..ce01ebd 100644 --- a/index.js +++ b/index.js @@ -2,7 +2,7 @@ * Module dependencies. */ -var md5 = require('md5'); +var sha256 = require('js-sha256'); var jsonp = require('jsonp'); var querystring = require('querystring'); @@ -19,7 +19,7 @@ exports.url = function (email, config) { config = config || {}; var qs = querystring.stringify(config); var qs = qs === '' ? '' : '?' + qs; - var url = 'https://secure.gravatar.com/avatar/' + md5(email.trim().toLowerCase()) + qs; + var url = 'https://secure.gravatar.com/avatar/' + sha256(email.trim().toLowerCase()) + qs; return url; }; @@ -32,7 +32,7 @@ exports.url = function (email, config) { */ exports.profile = function (email, fn) { - var url = 'https://secure.gravatar.com/' + md5(email.trim().toLowerCase()); + var url = 'https://secure.gravatar.com/' + sha256(email.trim().toLowerCase()); jsonp(url + '.json', function (err, obj) { if (err) return fn(err); if (obj && obj.entry) { diff --git a/package.json b/package.json index 7828bb5..ffdc81e 100644 --- a/package.json +++ b/package.json @@ -3,12 +3,11 @@ "description": "Simple browser implementation of the Gravatar API", "version": "1.1.1", "dependencies": { - "md5-component": "0.0.1", - "jsonp": "0.1.0", - "component-querystring": "1.3.2" + "component-querystring": "2.0.1", + "js-sha256": "0.9.0", + "jsonp": "0.1.0" }, "browser": { - "md5": "md5-component", "querystring": "component-querystring" }, "component": {