3 ms·
I am saying the same thing. Strings that can't make use of 0 have to be a small constant factor longer to store the same entropy, because each byte can only st
by eru 11y ago
I am saying the same thing.
Strings that can't make use of 0 have to be a small constant factor longer to store the same entropy, because each byte can only store log_2 (255) ~ 7.994 bits, instead of log_2 (256) = 8 bits.
Of course, if you are storing printable ascii characters only, that doesn't matter, since you are using far less than 256 possibilities per byte, and so don't care that some of them unused onces are used for in-band signalling (https://en.wikipedia.org/wiki/In-band_signaling https://en.wikipedia.org/wiki/In-band_signaling).
As vardump points out in another comment, that's equivalent to 1 in 177 bytes.
(See also https://en.wikipedia.org/wiki/Control_character https://en.wikipedia.org/wiki/Control_character)