LA14
LA14 is a simple, human-computable hash function for unit names. It is useful for creating a directory structure where there is one directory per unit. LA14 means "lower alphanumeric first and fourth". The LA14 hash of a unit name is made of two characters, lower case alphabetic, decimal and underscore.Definition
Let u be a unit name. Then LA14(u) = f(u1) f(u4) where f(x) is the lower case version of x if x is alphabetic, x itself if x is numeric, and underscore otherwise, or if x is undefined (ie if u is shorter than 4 characters), and u1 and u4 are the first and fourth characters of u. Note that the hash will start, like unit names, with an alphanumeric character.Performance
On 20,079 unit names, this gives 776 classes with 25.875 members on average and 930 members maximum, which is acceptable for filesystems and command-line arguments.Example
| Unit name | LA14 |
|---|---|
| 9base | 9s |
| aegis-virus-scanner | ai |
| Alien | ae |
| libc6-pic | l6 |
| lv | l_ |
| mp32ogg | m_ |
Version 1.2 last modified by Berke on 21/03/2006 at 10:54
Document data
Attachments:
No attachments for this document
Comments: 0