Path: utzoo!attcan!uunet!wuarchive!gem.mps.ohio-state.edu!apple!usc!henry.jpl.nasa.gov!elroy.jpl.nasa.gov!ucla-cs!uci-ics!news From: schmidt@glacier.ics.uci.edu (Doug Schmidt) Newsgroups: comp.lang.c Subject: Re: Perfect HASH functions..... Message-ID: <1989Sep23.192021.26473@paris.ics.uci.edu> Date: 23 Sep 89 19:20:21 GMT References: <9900014@bradley> Sender: news@paris.ics.uci.edu (Network News) Reply-To: schmidt@glacier.ics.uci.edu (Doug Schmidt) Organization: University of California, Irvine - Dept of ICS Lines: 35 In-reply-to: vijay@bradley.UUCP In article <9900014@bradley>, vijay@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@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.