On Wed, Feb 18, 2015 at 7:55 PM, <janhein.vanderb...@gmail.com> wrote: >> Take the >> easy option; you can always make things more complicated later. > That makes sense alright. > No offense, but I still believe that human readable text encoding complicates > things right now and shouldn't be tried until "my way" has proven unpractical > in its first application. > Consider it to be a theoretical challenge: how do I find the general encoding > of an arbitrary integer value that minimizes the number of bits needed and > given that algorithm, find the python code that minimizes the processor load > inflicted by the codec implementation. >
I would actually look at it the other way: a human-readable encoding is the easy way (you can simply print() your numbers and int() them on the way back in), and until you can prove that it's impractical, don't write a single line of code towards this algorithm. But let's get some figures, though: How many payload bits per byte can you achieve? What's your average going to be? You have two baselines to beat: 4 bits per byte (hexadecimal), and 7 bits per byte (MIDI varlen, or whatever you want to call it; I first met it with MIDI, but it's been used in so many places that other people have other names for it). ChrisA -- https://mail.python.org/mailman/listinfo/python-list