mrb113 / PerfectHash

Library for Windows to generate hash functions with no collisions in C
MIT License
4 stars 2 forks source link

about UCHAR_MAX #1

Open clark0081 opened 8 years ago

clark0081 commented 8 years ago

thanks a lot, it is a great example of perfect hash function, but i have two questions: in the document perfect.c , there is no definition of UCHAR_MAX, and in test.c I can't figure out why using 63580000 to calculate the kernelbasekeys array

mrb113 commented 8 years ago

Hi Clark,

I built this for Windows so UCHAR_MAX probably isn't defined for you. I'll fix it, but in the meantime, you can say

ifndef UCHAR_MAX

define UCHAR_MAX 0xff

endif

The test leaves a lot to be desired - I built the library for public consumption but not really the test. As for the data set, this is how I got the kernel base keys:

run "link /dump /headers /loadconfig" on kernelbase.dll from a machine running an x86 Windows build. Take the long list of numbers this will print out and subtract the “image base address” from each number to get the set of numbers you will hash. The image base address is the number you've listed.

That is not documented anywhere... I'll have to add it somewhere.

clark0081 commented 8 years ago

thanks a lot!