caesar-salad

API Docs for: v2.0.1
Show:

ROT5 Class

Defined in: rot5.js:6
Module: caesar-salad

The ROT5 Cipher is a monoalphabetic substitution cipher rotating 0..9 characters.

Examples using static factory methods:

ROT5.Cipher().crypt('0123456789');   // returns: '5678901234'
ROT5.Decipher().crypt('5678901234'); // returns: '0123456789'

Examples using constructors:

new ROT5().crypt('0123456789');       // returns: '5678901234'
new ROT5().crypt('5678901234');       // returns: '0123456789'

See Wikipedia for details.

Constructor

ROT5

()

Defined in rot5.js:6

Item Index

Methods

Methods

_substituteCharCode

(
  • charCode
)
Number protected

Inherited from SubstitutionCipher but overwritten in rot5.js:26

Substitutes only charCodes of 0..9 characters.

Parameters:

  • charCode Number

    the charCode to substitute.

Returns:

Number:

The substituted charCode.

Cipher

() ROT5 static

Defined in rot5.js:49

Static factory method to create cipher instances.

Returns:

ROT5:

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

() ROT5 static

Defined in rot5.js:60

Static factory method to create decipher instances.

Returns:

ROT5:

The Decipher.