/**
 * For the purposes of this function, we're assuming that the password generated is 
 * composed from a list of words, joined by separators and has a number at the end. 
 * e.g.
 * Hello-World_Example!1
 * 
 * @param {number} words            - the total number of words in the dictionary words are chosen from
 * @param {number} wordCount        - the number of words chosen for a password
 * @param {number} separatorCount   - the number of different possible separators (can be *any* token
 * 									  that is valid for use in a password, a common set might be [email protected]#$%^&*)
 * @param {number} maxGuessesPerSec - the maximimum amount of guesses per second your attacker might 
 *                                    make against the resulting list
 * 
 * @returns {Object} - an object containing the days, years, and centuries required to go through the entire list 
 */
function guesser(words, wordCount, separatorCount, tailingNumberCount, maxGuessesPerSec) {
    // Formula:
    // (words * separatorCount) ^ wordCount) * tailingNumberCount
    // JS needs Math.pow() sadface 
    var possibilities = Math.pow((words * separatorCount), wordCount) * tailingNumberCount;
    var secondsToComplete = possibilities / maxGuessesPerSec;
    var days = secondsToComplete / 60 / 60 / 24; 
    return {
        days: Math.floor(days),
        years: Math.floor(days / 365),
        centuries: Math.floor(days / 365 / 100),
    };

}
// e.g. 2000 words in the dictionary, 4 words for the password, 5 possible separators, 10 possible numbers, 1000000 guesses per second
// guesser( 2000, 4, 5, 10, 1000000 );
// =>
// {
//     days: 1157407, 
//     years: 3170, 
//     centuries: 31
// }
guesser( 2000, 4, 5, 10, 1000000 );