Asper Header  1.0.14
The header injector extension
Loading...
Searching...
No Matches
rot13.ts
Go to the documentation of this file.
1
13import { BaseCipher } from "../base/baseCipher";
14
22export class ROT13Cipher extends BaseCipher {
26 readonly CipherName = "ROT13";
27
34 super();
35 }
36
45 encode(input: string): string {
46 return input
47 .split("")
48 .map(character => this.shiftChar(character, 13))
49 .join("");
50 }
51
60 decode(input: string): string {
61 return this.encode(input);
62 }
63}
Abstract base class providing common functionality for cipher implementations.
Definition baseCipher.ts:18
Implementation of the ROT13 substitution cipher.
Definition rot13.ts:22
readonly CipherName
Identifier name for this cipher.
Definition rot13.ts:26
constructor()
Constructor for ROT13 cipher.
Definition rot13.ts:33
export const Record< string,(...args:any[])=> string