mercredi 24 novembre 2021

I draw 500 numbers from 0-10000, how to store them using Ruby and as few bits as possible, from which they can be decoded relatively quickly?

For example I can store them in an array, which can be saved as JSON. It's length is 2500 character in a particular case, and on average too.

I also can use a bitfield of 10_000 bits, in this case 10_000/8 ~ 1250 bytes is enough.

Maybe I can store them in a more space-saving way, but how?




Aucun commentaire:

Enregistrer un commentaire