Artifact 73c68067469dea5ffea1b8c5b825d7a75f1d9424
File www/base32.html part of check-in [dbda8d6ce9] - Initial check-in of m1 sources. by drh on 2007-07-21 14:10:57.
Base-32 Name Encoding
The name of a file or version in fossil is the SHA-256 hash of the content of that file or version expressed in a base-32 encoding. The digits of the base-32 encode are as follows:
0123456789abcdefghjkmnpqrstuvwxy
The letters "o", "i", and "l" are omitted from the encoding character set to avoid confusion with the digits "0" and "1". On input, upper and lower case letters are treated the same, the letter "o" is interpreted as a zero ("0") and the letters "i" and "l" are interpreted as a one ("1").
Each character of the base-32 encoding represents 5 bits of the hash. The first four bits of the SHA256 hash are repeated onto the end of the hash to make the hash a multiple of 5 bits in length. In this way, the final digit in the 52-digit base-32 number represents a full 5 bits.
As an example, the name of the current head version in fossil's self-hosting repository is:
wj5nmfgr2u62pnkd35a93h7481w2utdkgs2mptf8gyy6qswf1v47
Fossil uses the full 52-character filenames internally. But for human interaction, filenames are may be abbreviated to a unique prefix. In practice, 4 or 5 characters are usually sufficient to give a unique name prefix to files even in the largest of projects. So we can refer to the current version of fossil as just:
wj5nm