caesar-salad

API Docs for: v2.0.1
Show:

SubstitutionCipher Class

Abstract base class for substitution ciphers (and substitution deciphers).

Substitution ciphers replace letters of plaintext by other letters. See Wikipedia for details.

Item Index

Methods

Methods

_substituteCharCode

(
  • input
)
Number

Abstract method to substitute a single charCode.

Parameters:

  • input Number

    The charCode to process.

Returns:

Number:

The processed charCode.

Cipher

() SubstitutionCipher static

Abstract method to create a cipher instance.

Returns:

SubstitutionCipher:

The Cipher.

crypt

(
  • input
)
Number

Template method to encrypt/decrypt strings substituting its input charCode by charCode.

Parameters:

  • input String

    The string to process.

Returns:

Number:

The processed string.

Decipher

() SubstitutionCipher static

Abstract method to create a decipher instance.

Returns:

SubstitutionCipher:

The Decipher.