Originally Posted by
Ach1lles
I was unclear, so sorry about that. What I meant was that 0-255 store the 256 characters, so I'd have to use 256+ to store the combinations. When decoding, the number 256 would be deconstructed into AB, so the space requirements are the same.
Hopefully you know that code 257 can't be represented in 8 bits.
Code:
257 == 0x101 == 100000001
If your input file is purely alphabetic, encode A=0x41 ... Z=0x5A.
Do the same for strings i.e. AB=0x5B BC=0x5C CA=0x5D so on and so forth.
Originally Posted by
Ach1lles
I think I need to create a bitstream and use delimiters to note where I go from 9 to 10 bits, etc, but how would I do that? Is that even the best solution?
Perhaps you mean bitfields; only flip side is that they aren't portable.