4 ms·
No, compression only works when you don't need to represent every possibility, or can use less bytes for some inputs and more bytes for others. https://en.wiki
by negativegate 8y ago
No, compression only works when you don't need to represent every possibility, or can use less bytes for some inputs and more bytes for others.
https://en.wikipedia.org/wiki/Pigeonhole_principle#Uses_and_applications https://en.wikipedia.org/wiki/Pigeonhole_principle#Uses_and_...
- chrisseaton 8y agoWhy do you need to represent every possibility? You obviously aren't going to squeeze 2^42 objects into 2^42 bytes are you? They each take more than a byte. You don't need to address bytes individually. There's more holes than pigeons here.
- AaronFriel 8y agoSuppose we want to store 2^(48-n) 2^n byte objects in your hypothetical <42 bits of address space. Say, 2^47 two byte objects. (Alternatively, more than 2^(48-n) 2^n byte objects in 42 bits of address space.) How do I compute the hash of every object, since by definition I can't address every byte?
- chrisseaton 8y agoYou can still read any byte you want by decompressing the pointer and using it as normal. And why would you want to read raw bytes from an object to hash it? What requires this in Java?