From 6c99fd11689c4a2baf12262d12670746e550e9ce Mon Sep 17 00:00:00 2001 From: Douglas Muth Date: Wed, 1 Feb 2017 21:56:51 -0500 Subject: [PATCH] Removed old dice rolling logic. --- main.js | 44 -------------------------------------------- 1 file changed, 44 deletions(-) diff --git a/main.js b/main.js index 6dd3520..125d5dd 100644 --- a/main.js +++ b/main.js @@ -184,50 +184,6 @@ Diceware.rollDice = function(num_dice) { } // End of rollDice() -/** -* Roll a die. -* -* @return integer A random number between 1 and 6, inclusive. -*/ -Diceware.die_roll = function() { - - var retval; - - if (Diceware.i_can_has_good_crypto()) { - var a = new Uint32Array(1); - window.crypto.getRandomValues(a); - retval = (a[0] % 6) + 1; - - } else { - // - // Fall back to something way less secure. The user has already - // been warned. - // - retval = Math.floor(Math.random() * 6) + 1; - - } - - return(retval); - -} // End of die_roll() - - -/** -* Roll a die 5 times. -* -* @return array an Array of 5 dice rolls -*/ -Diceware.roll_dice = function() { - var retval = new Array(); - retval.push(Diceware.die_roll()); - retval.push(Diceware.die_roll()); - retval.push(Diceware.die_roll()); - retval.push(Diceware.die_roll()); - retval.push(Diceware.die_roll()); - return(retval); -} - - /** * Look up a word from our wordlist. *