Hi all(adsbygoogle = window.adsbygoogle || []).push({});

Basically, I'm looking for a fingerprinting or perfect hash function.

The key is 40 alpha characters, specifically \b[A-Z_]{40}\b.

The index is a 12-digit integer.

- The function must be deterministic, i.e. if a key maps to an index, it must always map to the same index.
- The function must not be surjective, i.e. only one key must map to each index, but there may be some indexes which do not have corresponding keys.
- The function does not need to be cryptographic.

Firstly, is it even possible to map this many keys to a maximum of 1x10^12 indexes?

If it is, I would appreciate any help on working out the algorithm. The end product has to be in Natural, but I should be able to translate from any C-style language.

Thanks so much!

Ross

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Perfect Hash Table Lookup with Unknown Keys?

**Physics Forums | Science Articles, Homework Help, Discussion**