Add Bacon cipher encoding

This commit is contained in:
Karsten Silkenbäumer 2019-03-02 17:33:17 +01:00
parent 77b098c5fe
commit a262d70b88
5 changed files with 320 additions and 7 deletions

View file

@ -9,7 +9,8 @@
import Operation from "../Operation";
import {
BACON_ALPHABET_REDUCED, BACON_ALPHABET_COMPLETE,
BACON_TRANSLATION_CASE, BACON_TRANSLATION_AMNZ, BACON_TRANSLATIONS, BACON_CLEARER_MAP, BACON_NORMALIZE_MAP
BACON_TRANSLATION_CASE, BACON_TRANSLATION_AMNZ, BACON_TRANSLATIONS, BACON_CLEARER_MAP, BACON_NORMALIZE_MAP,
swapZeroAndOne
} from "../lib/Bacon";
/**
@ -84,12 +85,7 @@ class BaconCipherDecode extends Operation {
}
if (invert) {
input = input.replace(/./g, function (c) {
return {
"0": "1",
"1": "0"
}[c];
});
input = swapZeroAndOne(input);
}
// group into 5