Asper Header  1.0.14
The header injector extension
Loading...
Searching...
No Matches
fractionatedMorse.ts
Go to the documentation of this file.
1
13import { BaseCipher } from "../base/baseCipher";
14import { MorseBasicCipher } from "./morseBasic";
15
23export class FractionatedMorseCipher extends BaseCipher {
27 readonly CipherName = "FractionatedMorse";
28
32 private alphabet: string;
33
39 private table: Record<string, string>;
40
47 super();
48 this.alphabet = FractionatedMorseCipher.ALPHABET + '0123456789';
49 this.table = {};
50
51 // For simplicity, map each character to itself (placeholder table)
52 for (const ch of this.alphabet) {
53 this.table[ch] = ch;
54 }
55
56 // TODO: Implement proper triplet-to-character mapping for real fractionated Morse
57 }
58
66 encode(plainText: string = ""): string {
67 // Currently uses MorseBasicCipher as a placeholder
68 const morse = new MorseBasicCipher();
69 return morse.encode(plainText);
70 }
71
80 decode(cipherText: string = ""): string {
81 const morse = new MorseBasicCipher();
82 return morse.decode(cipherText);
83 }
84}
Abstract base class providing common functionality for cipher implementations.
Definition baseCipher.ts:18
static readonly ALPHABET
Standard English alphabet for cipher operations.
Definition baseCipher.ts:44
Simplified implementation of the Fractionated Morse cipher.
readonly CipherName
Identifier name for this cipher.
constructor()
Constructor for Fractionated Morse cipher.
Implementation of Morse code encoding and decoding.
Definition morseBasic.ts:21
export const Record< string,(...args:any[])=> string