|
|
@ -2,6 +2,7 @@
|
|
|
|
(:require
|
|
|
|
(:require
|
|
|
|
[cipher-analytical-machine.ciphers.simple-substitution :as ss]
|
|
|
|
[cipher-analytical-machine.ciphers.simple-substitution :as ss]
|
|
|
|
[cipher-analytical-machine.parsers.parsers :as ps]
|
|
|
|
[cipher-analytical-machine.parsers.parsers :as ps]
|
|
|
|
|
|
|
|
[clojure.set :as set]
|
|
|
|
[cheshire.core :as cc])
|
|
|
|
[cheshire.core :as cc])
|
|
|
|
(:gen-class))
|
|
|
|
(:gen-class))
|
|
|
|
|
|
|
|
|
|
|
@ -42,3 +43,12 @@
|
|
|
|
(assoc "table" (ss/generate-substitution-table symbols)))
|
|
|
|
(assoc "table" (ss/generate-substitution-table symbols)))
|
|
|
|
(decode-key-and-substitution-table-from-json key-or-json)))
|
|
|
|
(decode-key-and-substitution-table-from-json key-or-json)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defn invert-table-in-map
|
|
|
|
|
|
|
|
"Invert the table in a decoded json (key, table)"
|
|
|
|
|
|
|
|
[decoded-json]
|
|
|
|
|
|
|
|
(->>
|
|
|
|
|
|
|
|
(-> decoded-json
|
|
|
|
|
|
|
|
(get "table")
|
|
|
|
|
|
|
|
(set/map-invert))
|
|
|
|
|
|
|
|
(assoc decoded-json "table")))
|
|
|
|
|
|
|
|
|
|
|
|