From fec4faced2cebd32cc97a844ff416bf46441379a Mon Sep 17 00:00:00 2001 From: Neil Smith Date: Mon, 7 Oct 2013 13:30:28 +0100 Subject: [PATCH] Fixed bug in Caesar break, added tests. --- cipher.py | 2 +- norms.pyc | Bin 5694 -> 7795 bytes 2 files changed, 1 insertion(+), 1 deletion(-) 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 540caf5c836c654bd2ccefced84763193e2689c8..97282d756e6b5cee539917570a18e33cb7cd597a 100644 GIT binary patch delta 1050 zcmb7CU2D@&7=BM$X45ov-Ar3IsX>u-FvdxfG>OwPrVLR~X;GmfQk&Fu_5+&^L|P`+ zi{93w_x=U(R{RP60)N16#Ebm_-_v$$rxsk`ea@Trlk+_1+uGr^<-nmFzV|ktFT?l~ z@Z3c6dxPaW*WD1j11N^T6^D)pUKrdkybz$Z4=#X9pe8|40#Ab72=o9*V;C)@rOyLB z#`@CMw$l~hYkBOKbR`&8Rh4~OD6)f)96j!P%KP5SaduZsC3uON%jG6x|34iiCi@Xd{xO;L zMQ6iYQ&-9>SGDfy>Tm;Hr=~?SnT%oE)V58{(Ty3avH!u}BR4P6sae#qGSs5Fsq0xY zYm8^HbnMN36d5~tRj!sFLV$%ivPe`?=Bx(M&Y;~u^XmvG4l@7hA#?zCfs1qV$t~yx zpiOwF6M*v_^zcab2(RX{Zg8i7Qn|vYj`gGS_Z4fbVO!v>SdJA+Asyhmex6Wsr_`!9 z8>bMnEFZN@33V|+kJ&tZI%-Yi8jjJ{Gq!1I#xdIep3bGVC%s2f>$c%gs#%U9Hfgy#FA%~M8 zijyIglOcBL7^egeBM&10@jw_u -- 2.34.1