var crypto = require('crypto');

var md5 = exports.md5 = function (data, format) {
    format = format || 'hex';
    var hash = crypto.createHash('md5');
    hash.update(data);
    return hash.digest(format);
};

var sha1 = exports.sha1 = function (data, format) {
    format = format || 'hex';
    var hash = crypto.createHash('sha1');
    hash.update(data);
    return hash.digest(format);
};
