From: Neil Smith Date: Mon, 7 Oct 2013 12:30:28 +0000 (+0100) Subject: Fixed bug in Caesar break, added tests. X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=fec4faced2cebd32cc97a844ff416bf46441379a;p=cipher-tools.git Fixed bug in Caesar break, added tests. --- diff --git a/cipher.py b/cipher.py index b883abe..85de0a5 100644 --- a/cipher.py +++ b/cipher.py @@ -114,7 +114,7 @@ def caesar_break(message, metric=norms.euclidean_distance, target_frequencies=no >>> caesar_break('ibxcsyorsaqcheyklxivoexlevmrimwxsfiqevvmihrsasrxliwyrhecjsppsamrkwleppfmergefifvmhixscsymjcsyqeoixlm') (4, 0.3186395289018361) >>> caesar_break('jhzhuhfrqilqhgwrdevwudfwuhdvrqlqjwkhqkdylqjvxemhfwhgwrfulwlflvpwkhhasodqdwlrqrisrzhuwkdwmxulglfdovfl') - (3, 0.32902042861730835) + (3, 0.3290204286173084) >>> caesar_break('wxwmaxdgheetgwuxztgptedbgznitgwwhpguxyhkxbmhvvtlbhgteeraxlmhiixweblmxgxwmhmaxybkbgztgwztsxwbgmxgmert') (19, 0.4215290123583277) >>> caesar_break('yltbbqnqnzvguvaxurorgenafsbezqvagbnornfgsbevpnaabjurersvaquvzyvxrnznazlybequrvfohgriraabjtbaruraprur') diff --git a/norms.pyc b/norms.pyc index 540caf5..97282d7 100644 Binary files a/norms.pyc and b/norms.pyc differ