On Sat, Mar 23, 2002 at 04:33:06PM +0200, Vasilis Vasaitis wrote: > On Fri, Mar 22, 2002 at 12:03:08PM +0800, Anthony Fok wrote: > > Cool! (Thanks for the info!) Although this won't be needed unless X > > supports beyond BMP... Or are you implying that this will come in handy > > when Xft is used to render fonts for the BIG5-HKSCS encoding? Woohoo! ;-) > > > > And yeah, if Xlib already has this function, I don't have to go write one > > from scratch blindly (because I am new to hashing... ;-) Thanks for the > > tip! :-) > > You might also want to try GNU gperf, a perfect hash function generator. I > haven't used it personally, but AFAIK it's a good tool for this kind of > task. >
gperf will generate a hash function for a known set of data. It will generate an almost perfect hash with a few collisions. Actually, the size of the hash table can be control at command line. Collisions are handled by the generated hash functions for you. Very easy to use, I used it to hash the frequency of Chinese character in zh-autoconvert (A Chinese encoding converter written by saka). For 400 items, a hash table of size around 1000, and 5 collisions. Of cause it is for my specific data. -- Best regard hashao _______________________________________________ I18n mailing list [EMAIL PROTECTED] http://XFree86.Org/mailman/listinfo/i18n