3 ms·
As long as you know the index into p of your file and its length, its a simple task to extract the file using the Bailey–Borwein–Plouffe formula Similar
by remx 10y ago
As long as you know the index into p of your file and its length,
its a simple task to extract the file using the Bailey–Borwein–Plouffe
formula Similarly, you can use the formula to initially find the index of your file
Now, we all know that it can take a while to find a long sequence of digits in p,
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 p.
I'm not entirely convinced my files would be present in those smaller chunks. You would need a copy of π (p) going way past the 5 trillion digit world record. Even then it's not guaranteed the bytes needed would be there.
- daxelrod 10y agoBailey–Borwein–Plouffe lets you calculate the nth binary digit of pi without calculating 0..n-1. You would not need to store the entire number. https://en.wikipedia.org/wiki/Bailey%E2%80%93Borwein%E2%80%93Plouffe_formula https://en.wikipedia.org/wiki/Bailey%E2%80%93Borwein%E2%80%9... You