Skip to content

Commit

Permalink
Fix misrepresentation of encoding formatting
Browse files Browse the repository at this point in the history
There is no flag or argument for encoding without breaking into blocks
  • Loading branch information
orome committed May 6, 2019
1 parent 6fb44e0 commit bddc0fc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Crypto/Enigma/Display.hs
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ Show the conventionally formatted encoding of a 'Message' by an (initial) Enigma
>>> putStr $ displayEnigmaEncoding cfg "FOLGENDES IST SOFORT BEKANNTZUGEBEN"
RBBF PMHP HGCZ XTDY GAHG UFXG EWKB LKGJ
-}
-- TBD: Add new arguments for formatting (and use in cli)
-- TBD: Add new arguments for formatting, and use in cli (#33) <<<
displayEnigmaEncoding :: EnigmaConfig -> Message -> String
displayEnigmaEncoding ec str = postproc $ enigmaEncoding ec (message str)
where
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ Haskell installations, provides almost all the functionality of the API.
Encode messages:

$ enigma encode "B-I-III-I EMO UX.MO.AY 13.04.11" "TESTINGXTESTINGUD"
OZQKPFLPYZRPYTFVU
OZQK PFLP YZRP YTFV U

$ enigma encode "B-I-III-I EMO UX.MO.AY 13.04.11" "OZQKPFLPYZRPYTFVU"
TESTINGXTESTINGUD
TEST INGX TEST INGU D

Show configuration details (explained in more detail in the command line help):

Expand Down
11 changes: 2 additions & 9 deletions cli/enigma.hs
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,7 @@ topFoot = "Examples:\n" ++ topExamples ++ "\nThis command line interface is part

topExamples = unlines [
" $ enigma encode \"B-I-III-I EMO UX.MO.AY 13.04.11\" \"TESTINGXTESTINGUD\"",
" $ enigma encode \"B-I-III-I EMO UX.MO.AY 13.04.11\" \"TESTINGXTESTINGUD\" -f",
" $ enigma encode \"B-I-III-I EMO UX.MO.AY 13.04.11\" \"TESTING! testing?\" -f",
" $ enigma encode \"B-I-III-I EMO UX.MO.AY 13.04.11\" \"TESTING! testing?\"",
" $ enigma show \"B-I-III-I EMO UX.MO.AY 13.04.11\" -l 'X'",
" $ enigma show \"B-I-III-I EMO UX.MO.AY 13.04.11\" -l 'X' -H '()'",
" $ enigma show \"B-I-III-I EMO UX.MO.AY 13.04.11\" -l 'X' -H '()' -f internal",
Expand All @@ -295,17 +294,11 @@ topExamples = unlines [
encodeCmdExamples = init $ unlines [
" Encode a message:",
" $ enigma encode \"B-I-III-I EMO UX.MO.AY 13.04.11\" \"TESTINGXTESTINGUD\"",
" OZQKPFLPYZRPYTFVU",
" $ enigma encode \"B-I-III-I EMO UX.MO.AY 13.04.11\" \"OZQKPFLPYZRPYTFVU\"",
" TESTINGXTESTINGUD",
"",
" Encode a message and break the output into blocks of 4:",
" $ enigma encode \"B-I-III-I EMO UX.MO.AY 13.04.11\" \"TESTINGXTESTINGUD\" -f",
" OZQK PFLP YZRP YTFV U",
"",
" Standard Naval subistitutions for non-letter characters are performed",
" before encoding:",
" $ enigma encode \"B-I-III-I EMO UX.MO.AY 13.04.11\" \"TESTING! testing?\" -f",
" $ enigma encode \"B-I-III-I EMO UX.MO.AY 13.04.11\" \"TESTING! testing?\"",
" OZQK PFLP YZRP YTFV U"]

showCmdExamples = init $ unlines [
Expand Down

0 comments on commit bddc0fc

Please sign in to comment.