Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
gravatar link generator
#!/usr/bin/env node
var email = process.argv[2];
var crypto = require('crypto');
function trim (str) {
var str = str.replace(/^\s\s*/, ''),
ws = /\s/,
i = str.length;
while (ws.test(str.charAt(--i)));
return str.slice(0, i + 1);
if(process.argv.length !== 3){
console.log("usage: gravatar <email>");
var md5sum = crypto.createHash('md5');
var hash = md5sum.digest('hex');
console.log("" + hash);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment