From: Neil Smith Date: Wed, 4 Jun 2014 19:14:26 +0000 (+0100) Subject: Tweaked keyword_wrap_alphabet enumeration values X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=fd4d8412589611d63f59a23424e919350fa827ed;p=cipher-training.git Tweaked keyword_wrap_alphabet enumeration values --- diff --git a/cipher.py b/cipher.py index ba62d41..e39abce 100644 --- a/cipher.py +++ b/cipher.py @@ -242,9 +242,9 @@ def affine_decipher(message, multiplier=1, adder=0, one_based=True): class Keyword_wrap_alphabet(Enum): - from_a = 0 - from_last = 1 - from_largest = 2 + from_a = 1 + from_last = 2 + from_largest = 3 def keyword_cipher_alphabet_of(keyword, wrap_alphabet=Keyword_wrap_alphabet.from_a): diff --git a/cipherbreak.py b/cipherbreak.py index 0d3fd78..2a70cee 100644 --- a/cipherbreak.py +++ b/cipherbreak.py @@ -133,7 +133,7 @@ def keyword_break(message, wordlist=keywords, fitness=Pletters): >>> keyword_break(keyword_encipher('this is a test message for the ' \ 'keyword decipherment', 'elephant', Keyword_wrap_alphabet.from_last), \ wordlist=['cat', 'elephant', 'kangaroo']) # doctest: +ELLIPSIS - (('elephant', ), -52.834575011...) + (('elephant', ), -52.834575011...) """ best_keyword = '' best_wrap_alphabet = True @@ -164,7 +164,7 @@ def keyword_break_mp(message, wordlist=keywords, fitness=Pletters, chunksize=500 >>> keyword_break_mp(keyword_encipher('this is a test message for the ' \ 'keyword decipherment', 'elephant', Keyword_wrap_alphabet.from_last), \ wordlist=['cat', 'elephant', 'kangaroo']) # doctest: +ELLIPSIS - (('elephant', ), -52.834575011...) + (('elephant', ), -52.834575011...) """ with Pool() as pool: helper_args = [(message, word, wrap, fitness)