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 nameLA14
9base9s
aegis-virus-scannerai
Alienae
libc6-picl6
lvl_
mp32oggm_
Version 1.2 last modified by Berke on 21/03/2006 at 10:54

Comments 0

No comments for this document

Attachments 0

No attachments for this document

Creator: Berke on 2006/03/21 10:53
Copyright EDOS Consortium
1.1.1