ROT18 Class
The ROT18 Cipher is a monoalphabetic substitution cipher combining ROT13 and ROT5.
Examples using static factory methods:
ROT18.Cipher().crypt('ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'); // returns: 'NOPQRSTUVWXYZABCDEFGHIJKLM5678901234'
ROT18.Decipher().crypt('NOPQRSTUVWXYZABCDEFGHIJKLM5678901234'); // returns: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
Examples using constructors:
new ROT18().crypt('ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'); // returns: 'NOPQRSTUVWXYZABCDEFGHIJKLM5678901234'
new ROT18().crypt('NOPQRSTUVWXYZABCDEFGHIJKLM5678901234'); // returns: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
See Wikipedia for details.
Constructor
ROT18
()
Item Index
Methods
- _substituteCharCode
- Cipher static
- crypt
- Decipher static
Methods
_substituteCharCode
(
Number
protected
-
charCode
Substitutes only charCodes of A..Z
, a..z
and '0..9' characters.
Parameters:
-
charCode
Numberthe charCode to substitute.
Returns:
Number:
The substituted charCode.
Cipher
()
ROT18
static
Static factory method to create cipher instances.
Returns:
ROT18:
The Cipher.