~gagbo/diceware.py

75053a83612a1ba460486304bbf1dc42478bed9b — Gerry Agbobada 2 years ago 5191587
Make it clear that lists should have 5-dice words

The number 5 is currently hardcoded in a few places (most notably the
key generation for the dictionnary, but also in 'error handling' when
reading a new wordlist, or when actually generating the word with only
5-uples). So it's better to warn users at least in the documentation

Signed-off-by: Gerry Agbobada <gagbobada+git@gmail.com>
2 files changed, 7 insertions(+), 1 deletions(-)

M dice_dict/list_to_dict.py
M dice_rolls/diceware_result.py
M dice_dict/list_to_dict.py => dice_dict/list_to_dict.py +3 -0
@@ 1,6 1,9 @@
#!/usr/bin/env python3
# coding: utf-8
""" words_list : Utilities to generate a python dictionary from a words list
    The behaviour is undefined if used with a word list which does not use
5-throw lists (with results per word being '11111' to '66666' inclusive with
only digits in 1-6 inclusive)
"""



M dice_rolls/diceware_result.py => dice_rolls/diceware_result.py +4 -1
@@ 1,6 1,9 @@
#!/usr/bin/env python3
# coding: utf-8
""" diceware_result : Utilities to generate dice rolls for diceware method
""" diceware_result : Utilities to generate dice rolls for diceware method.
    The count of rolls per word (currently 5 die per word), is hardcoded in
a few places and behaviour with non 5-throw lists (from '11111' to '66666'
with only 1-6 inclusive digits) is undefined.
"""
import random