perfect-hash

Determining Perfect Hash Lookup Table for Pearson Hash

I'm developing a programming language, and in my programming language, I'm storing objects as hash tables. The hash function I'm using is Pearson Hashing, which depends on a 256-bit lookup table. Here's the function: char* pearson(char* name, char* lookup) { char index = '\0'; while(*name) { index = lookup[index ^ ...

Perfect hash in Scala.

I have some class C: class C (...) { ... } I want to use it to index an efficient map. The most efficient map is an Array. So I add a "global" "static" counter in companion object to give each object unique id: object C { var id_counter = 0 } In primary constructor of C, with each creation of C I want to remember global counter ...

Is there a way to make this hash lookup any faster?

I have a requirement to (very) quickly process strings of a limited range, tallying their values. The input file is of the form: January 7 March 22 September 87 March 36 and so forth. Because the line widths are identical, I can simply read in a line with fread reasonably fast, and I've developed a perfect hashing function ...

Using CMPH in VC++

I would like to use minimal perfect hash from CMPH. Any idea how can I use it on a VC++ project? I created a new project using VC++ 2008 Express Edition here and add the header and source files but it output compilation errors. 1>------ Build started: Project: CMPH, Configuration: Release Win32 ------ 1>Compiling... 1>wingetopt.c 1>vs...