Asper Header  1.0.14
The header injector extension
Loading...
Searching...
No Matches
CaesarCipher Class Reference

Implementation of the Caesar substitution cipher. More...

Inheritance diagram for CaesarCipher:
Inheritance graph
Collaboration diagram for CaesarCipher:
Collaboration graph

Public Member Functions

 constructor (shift:number=3)
 Constructor for Caesar cipher.
 

Data Fields

readonly CipherName = "Caesar"
 Identifier name for this cipher.
 
- Data Fields inherited from BaseCipher
abstract abstract encode(plaintext:string, key?:any) abstract decode(ciphertext:string, key?:any) readonly CipherName: string
 Abstract method to encode plaintext.
 

Additional Inherited Members

- Static Public Attributes inherited from BaseCipher
static readonly ALPHABET: string = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
 Standard English alphabet for cipher operations.
 

Detailed Description

Implementation of the Caesar substitution cipher.

A monoalphabetic substitution cipher where each letter in the plaintext is shifted a certain number of places down or up the alphabet. The shift amount is configurable (default is 3, as used by Julius Caesar).

Definition at line 21 of file caesar.ts.

Member Function Documentation

◆ constructor()

CaesarCipher::constructor ( shift:number = 3)
inline

Constructor for Caesar cipher.

Parameters
shiftNumber of positions to shift (default: 3, as used by Julius Caesar)

Initializes the cipher with a specific shift value. Positive values shift forward in the alphabet, negative values shift backward.

Definition at line 38 of file caesar.ts.

Field Documentation

◆ CipherName

readonly CaesarCipher::CipherName = "Caesar"

Identifier name for this cipher.

Definition at line 30 of file caesar.ts.


The documentation for this class was generated from the following file: