30 private map: Record<string, string> = {};
35 private inv: Record<string, string> = {};
47 '!',
'"',
'#',
'$',
'%',
'&',
'\'',
'(',
')',
'*',
'+',
',',
'-',
'.',
'/',
48 ':',
';',
'<',
'=',
'>',
'?',
'@',
'[',
']',
'^',
'_'
51 for (let i = 0; i < 26; i++) {
64 encode(plainText:
string =
""): string {
67 .map(c => this.map[c.toUpperCase()] ?? c)
78 decode(cipherText:
string =
""):
string {
81 .map(c => this.inv[c] ?? c)
Abstract base class providing common functionality for cipher implementations.
static readonly ALPHABET
Standard English alphabet for cipher operations.
Implementation of the Pigpen (Freemason's) substitution cipher.
constructor()
Constructor for Pigpen cipher.
readonly CipherName
Identifier name for this cipher.
export const Record< string,(...args:any[])=> string