Thursday, 29 October 2026

Character space vs storage space

 Storage space — how many distinct bit patterns a fixed amount of memory can hold:

2^bits

A byte = 2⁸ = 256 patterns (0–255). A 5-byte field = 2⁴⁰ ≈ 1.1 trillion patterns. This depends only on the memory, not on what you store.

Character space — how many distinct strings a format can produce:

L^n        L = alphabet size, n = characters

5 chars from a 34-symbol alphabet = 34⁵ = 45,435,424 strings. This depends only on the format, not on the memory.

They're equal only when the alphabet is a power of 2

FormatLnCharacter spaceStorage space (1 byte/char)Fraction used
binary28256 = 2⁸2⁸ = 2561 (no waste)
hex16516⁵ = 2²⁰2⁴⁰1/1,048,576
base-6464564⁵ = 2³⁰2⁴⁰1/1,024
decimal10510⁵ ≈ 2¹⁶.⁶2⁴⁰~1/11,000,000
base-34 (SN)34534⁵ ≈ 2²⁵.⁴2⁴⁰1/24,200



character space intheory is 36 0123456789abcde..z
Theoretically available alphanumerics36 (0-9, A-Z)

No comments:

Post a Comment