Railfence Code

What is does:

Encode:

Takes the first character in the string and adds it to string 1
Takes the next character and adds it to string 2
Takes the third character and adds it to string 1
Takes the fourth character and adds it to string 2
Takes the fifth character and adds it to string 1
Takes the sixth character and adds it to string 2
Takes the seventh character and adds it to string 1
Takes the eight character and adds it to string 2

Output=string1+string2

Decode:

Finds the string length
If odd number of characters, splits into 2 strings about the same length, longer one is string 1, shorter one is string 2

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License