Skip to content

Instantly share code, notes, and snippets.

@HomenSimpsor
Created August 23, 2013 20:24
Show Gist options
  • Save HomenSimpsor/6323616 to your computer and use it in GitHub Desktop.
Save HomenSimpsor/6323616 to your computer and use it in GitHub Desktop.
How many letters can be generated from an n-word diceware phrase
function howMany(n) {
var L = Math.pow(7776, n);
var num = Math.log(L);
var den = Math.log(26);
var total = num / den;
//console.log("result", L, num, den, total);
console.log("A diceware phrase of", n, "words will give", total, "letters")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment