| ▲ | hatthew 4 hours ago | |||||||||||||
TFA addresses this > Now, we all know that it can take a while to find a long sequence of digits in π, so for practical reasons, we should break the files up into smaller chunks that can be more readily found. > In this implementation, to maximise performance, we consider each individual byte of the file separately, and look it up in π. | ||||||||||||||
| ▲ | ithkuil 3 hours ago | parent [-] | |||||||||||||
Why stop at bytes? Let's split it in individual bits and then look up the bits in pi! But Pi's binary expansion is not very practical for this purpose, since it's 11.0010... OTOH. e is 10.1011... Let's stick to fractional digits (the ones right of the binary point) at index 0 we have 1 and at index 1 we have 0. So, to encode a stream of bytes so that each bit is encoded as the index of that bit in the e, all you need to do is to xor it with 0xFF | ||||||||||||||
| ||||||||||||||