Skip to content

Instantly share code, notes, and snippets.

@JosiahParry
Created October 10, 2019 17:58
Show Gist options
  • Save JosiahParry/324e657ff025d9eac62ba41221a45216 to your computer and use it in GitHub Desktop.
Save JosiahParry/324e657ff025d9eac62ba41221a45216 to your computer and use it in GitHub Desktop.
Simple function for generating diceware passwords
library(tidyverse)
dice_words <- read_tsv("https://www.eff.org/files/2016/07/18/eff_large_wordlist.txt",
col_names = c("dice_id", "dice_word"), col_types = "cc")
diceware <- function(n_words) {
map_dfr(1:n_words, ~tibble(dice_id = paste(sample(1:6, 5, replace = TRUE), collapse = ""))) %>%
left_join(dice_words)
}
diceware(6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment