Perfect HASH functions.....

Doug Schmidt schmidt at glacier.ics.uci.edu
Sun Sep 24 05:20:21 AEST 1989


In article <9900014 at bradley>, vijay at bradley writes:
>
>Hello,      
>
>   I hope you can help me. Does anyone out there have a perfect
>hash function? The key is a string of characters (maximum length
>is 4, minimum is 2) that make up the opcode set of an assembler
>that I am in the process of writing. I tried some home-brewed
>hash functions, but got some collisions. I also tried to read some
>articles on the subject in ACM, but you need a PHD in maths to
>make any sense out of them!! Any help would be appreciated.
>
>Thanks in advance (you can e-mail me directly, if you please..)

If you've got access to anonymous ftp you should pick up my perfect
hash function generator program `gperf.'  It is available from
ics.uci.edu (128.195.1.1) in ~ftp/pub/cperf-1.8.tar.Z.  

Written in C, this program is used to automatically generate the
reserved word lookup routines used in the GNU C, GNU C++, and GNU
Pascal compilers, as well as the GNU indent program.

The distribution comes with extensive documentation, and should
compile easily with standard K&R C compilers.

If you don't have access to anonymous ftp I can send you a version via
email, or you can wait until gperf is posted to comp.sources.unix
(shortly, I hope!).

  Doug
--
schmidt at ics.uci.edu (ARPA) |   Per me si va nella citta' dolente.
office: (714) 856-4043     |   Per me si va nell'eterno dolore.
                           |   Per me si va tra la perduta gente.
                           |   Lasciate ogni speranza o voi ch'entrate.



More information about the Comp.lang.c mailing list