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

\n