dbda8d6ce9 2007-07-21 drh: <html> dbda8d6ce9 2007-07-21 drh: <head> dbda8d6ce9 2007-07-21 drh: <title>Fossil - Base-32 Name Encoding</title> dbda8d6ce9 2007-07-21 drh: </head> dbda8d6ce9 2007-07-21 drh: <body bgcolor="white"> dbda8d6ce9 2007-07-21 drh: <h1>Base-32 Name Encoding</h1> dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: <p>The name of a file or version in fossil is the dbda8d6ce9 2007-07-21 drh: <a href="http://en.wikipedia.org/wiki/SHA-1">SHA-256</a> hash of dbda8d6ce9 2007-07-21 drh: the content of that file or version expressed in a base-32 dbda8d6ce9 2007-07-21 drh: encoding. The digits of the base-32 encode are as dbda8d6ce9 2007-07-21 drh: follows: dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: <blockquote><b> dbda8d6ce9 2007-07-21 drh: 0123456789abcdefghjkmnpqrstuvwxy dbda8d6ce9 2007-07-21 drh: </b></blockquote> dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: <p>The letters "o", "i", and "l" are omitted from the dbda8d6ce9 2007-07-21 drh: encoding character set to avoid confusion with the dbda8d6ce9 2007-07-21 drh: digits "0" and "1". On input, upper and lower case dbda8d6ce9 2007-07-21 drh: letters are treated the same, the letter "o" is dbda8d6ce9 2007-07-21 drh: interpreted as a zero ("0") and the letters "i" and dbda8d6ce9 2007-07-21 drh: "l" are interpreted as a one ("1").</p> dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: <p> dbda8d6ce9 2007-07-21 drh: Each character of the base-32 encoding represents 5 bits dbda8d6ce9 2007-07-21 drh: of the hash. The first four bits of the SHA256 hash are dbda8d6ce9 2007-07-21 drh: repeated onto the end of the hash to make the hash a multiple dbda8d6ce9 2007-07-21 drh: of 5 bits in length. In this way, the final digit in the dbda8d6ce9 2007-07-21 drh: 52-digit base-32 number represents a full 5 bits. dbda8d6ce9 2007-07-21 drh: </p> dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: <p>As an example, the name of the current head version in dbda8d6ce9 2007-07-21 drh: fossil's self-hosting repository is:</p> dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: <blockquote><b> dbda8d6ce9 2007-07-21 drh: wj5nmfgr2u62pnkd35a93h7481w2utdkgs2mptf8gyy6qswf1v47 dbda8d6ce9 2007-07-21 drh: </b></blockquote> dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: <p>Fossil uses the full 52-character filenames internally. dbda8d6ce9 2007-07-21 drh: But for human interaction, filenames dbda8d6ce9 2007-07-21 drh: are may be abbreviated to a unique prefix. dbda8d6ce9 2007-07-21 drh: In practice, 4 or 5 dbda8d6ce9 2007-07-21 drh: characters are usually sufficient to give a unique dbda8d6ce9 2007-07-21 drh: name prefix to files even in the largest of projects. dbda8d6ce9 2007-07-21 drh: So we can refer to the current version of fossil as just:</p> dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: <blockquote><b> dbda8d6ce9 2007-07-21 drh: wj5nm dbda8d6ce9 2007-07-21 drh: </b></blockquote> dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: </body> dbda8d6ce9 2007-07-21 drh: </html>