UUIDs, IPv6 addresses and MD5 hashes are
specially formatted 128-bit numbers, referred to as
hexlets.
Randomly chosen 128-bit numbers have a collision probability that is small
enough to make them useful as (practically) unique identifiers in
applications where a centralized management of IDs is not feasible or not
desirable. However since they are long strings of numerals and letters,
without overt semantic content, they are hard to distinguish by eye. This
creates difficulties when developing, or debugging with structured data, or
for the curation of ID tagged information. The qqid
package provides
tools to convert the leading 20-bits of 128-bit numbers to two "Q-words",
and the remainder to a string of 18 Base64 encoded characters. The
"Q-words" - the letter Q evokes the word "cue" i.e. a hint or mnemonic -
define a unique and invertible mapping to 2^10 integers (0, 1023). Thus two
Q-words can encode 20 bits, or 5 hexadecimal letters:
.
. [0-9a-f] [0-9a-f] [0-9a-f] [0-9a-f] [0-9a-f]
. hex: |--0x[1]--| |--0x[2]--| |--0x[3]--| |--0x[4]--| |--0x[5]--|
. bit: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
. |----------int[1]-----------| |----------int[2]-----------|
. int: (0, 1023) (0,1023)
. Q: (aims, ..., zone) . (aims, ..., zone) . Base64...
.