var letters = 'abcdefghijklmnopqrstuvwxyz';
var digits = exports.digits = '0123456789';
var lower = exports.lower = letters;
var upper = exports.upper = letters.toUpperCase();
var alpha = exports.alpha = lower + upper;
var alnum = exports.alnum = lower + upper + digits;

var randomString = exports.randomString = function (length, chars) {
    length = length || 10;
    chars = chars || alpha;

    var text = '', i;

    for (i = 0; i < length; i++) {
        text += chars.charAt(Math.floor(Math.random() * chars.length));
    }

    return text;
};

var randomInt = exports.randomInt = function (max, min) {
    max = max || 99999;
    min = min || 0;

    return Math.floor(Math.random() * (max - min + 1)) + min;
};
