The Charm
Edited Feb 8, 2026 | Posted Jul 29, 2025 | ~4 minute read
A charm (short for character message) is a unit of hartley entropy and storage capacity equal to six bits. It measures the entropy of a data model in terms of the length of base-64 encoded data needed to represent its worst-possible case, given an encoding method that perfectly achieves the lower-bound of compression. The unit is used throughout this platform to measure and discuss the size of a system's state space.
Background
The Kireji Web Framework builds ecosystems that unite multiple applications into a single common state space. It does this in order to offer a permanent link to every possible state the ecosystem can occupy. Part of the challenge of providing a dedicated URL to every state is making sure that those URLs are not too long or difficult to parse. Entropy here measures the number of states that a system can be in in terms of the number of symbols needed to disambiguate any one of those states from all of the others. The value of that measurement for the Kireji Web framework is that it makes it extremely clear how long a URL might need to get in order to encode the worst-case state of the ecosystem, given the best-case compression method.
Achieving the optimal compression in this case means achieving a minimal perfect hash function - a bijection between the space of all possible URL-encoded data strings (which is quite large) and the space of all possible system states. No two URLs should point to the same state and vice versa and there should be no gaps (URLs that are structurally valid but don't point to a valid application state). Thanks to this bijection, the Kireji Web Framework achieves the information-theoretic lower bound — the hard limit for lossless, deterministic data compression. Because we achieve this bound, the question of how long URLs will get in the system is the same as the question of how much entropy is in the ecosystem.
Bits are a very common unit for measuring entropy but they aren't convenient for discussing URL length. Information theory pioneers Hartley and Shannon proposed measuring information content in terms of the real physical units that will be used to store and handle that information. When we talk about URLs with base-64-encoded data strings, each character of those data strings is a single sexagesiquaternary digit. In order to avoid having to repeatedly say "base-64 character" or "sexagesiquaternary digit", I coined the term charm.
Computed from State Space Cardinality
To measure the entropy in charms of an app ecosystem (or any component within that system), we simply measure the length of the base-64 data string representing the index of the last possible state in the system (starting at 0). This is similar - but not identical - to taking the logarithm of the number of states the system can be in.
Let be the total cardinality of the set of all states a system can occupy. For this platform, is equal to the following (rather large) number:
928835568177198442170573314336572582105263578631620260048928471260096563744070517030885530740318678284543523018628848940052133966629320481152472311608937481865882859761402284838417656417019907847763988890971649522803705978007294259671498388521615360000000000000000000000000000
The first state in our state space is assigned the number , so the last state in the space is assigned the number :
928835568177198442170573314336572582105263578631620260048928471260096563744070517030885530740318678284543523018628848940052133966629320481152472311608937481865882859761402284838417656417019907847763988890971649522803705978007294259671498388521615359999999999999999999999999999
This is the largest possible integer that can be assigned to the platform. Other hashes may be smaller, but we're most interested in looking at the worst possible case. We could try and compute :
152.78340661969017
But, when discussing string length, the meaning of the fractional part of the logarithm (sometimes called the "mantissa") becomes abstract. We can't have a URL with a fraction of a character.
In the Kireji Web Framework, computing this logarithm is less convenient than simply hashing using the framework's actual URL encoder:
qQ-64X8J-qsTL70f6xVR_8CLFtyf80ZeJvRcnaPGIkGNaC1UkN8q6p-QhNqZ0LiGto2lzGXo-jym3buQLxBYVeDlsIJEl4KStsviXGLvv________________________________________________
We know all other data strings will be the same length or shorter than than this one. So, we simply measure this string's length. When measured this way, the entropy we get is:
153 charms
One Small Note
Unlike a conventional base-64 numeral (where and leading zeros can be omitted) this framework employs a hash function such that two different strings never map to the same integer. The string “1” maps to one integer, “01” to another and “001” to yet another. In these scheme, the empty string ("") maps to whereas "0" actually maps to .
While the maximum hash length (in charms) provides a convenient and close approximation to the entropy , note that the two differ by a small constant (typically <1 charm), depending on how fully the final hash length is utilized. For precise entropy calculations, use directly.
Conclusion
The word "charm" is short and sweet and it isn't used for any other units. I needed such a word to describe the unit of entropy and information content equal to one base-64 character, so that's what I chose. I hope you find this unit as useful and convenient as I have.
EJ's Notebook - The Charm