The idea behind this project is to teach myself the how big endian and little endian formats work. The encoder reverses the order of letters in each word and then it swaps each pair of letters from left to right. The second letter becomes the first, the first the second, the fourth becomes third and third is fourth and so on for the length of the word. Odd numbered words leave the last letter in the same position.
To encode the word endian
First it reverses the order to naidne
Then swap the lettered pairs andien
na swaps to an, id swaps to di, and ne swaps to en
To decode andien
It swaps the paired letters back to their original position and then reverses each word.
andien becomes naidne (swaping an di en to na di en).
naidne is then reversed to endian