66 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
3
votes
2
answers
200
views
What kind of implementation can I use for a static associative array on a vintage system with very limited resources?
I'm working on a project written in C that's going to be deployed on vintage systems with very limited resources. The target system has at minimum a 16 MHz Motorola 68030 processor with a 256 byte L1 ...
0
votes
3
answers
203
views
How to create perfect hash with ASCII symbols as input, where output hash is always the same for each ASCII sequence, even after adding more later? [closed]
I have this code so far, which performs some kind of hashing. The goal is to map each ASCII string to a single Hangul Syllable unicode point:
const HANGUL_START = 0xAC00; // Start of Hangul ...
0
votes
2
answers
97
views
Minimal perfect hash function that retains mapping of existing keys on expansion
I have a set of N integers in the range 0 to 255 which must be mapped using a minimally perfect hash function to the range [0, N-1]. However, this set of integers can grow dynamically. In the case ...
2
votes
1
answer
247
views
Seeking an Efficient Perfect Hashing Function integer keys running on a small MCU?
I am developing a CANopen slave stack on a 200 MHz microcontroller and require a highly efficient lookup method to match a 16-bit object index (e.g., 0x603d) with a table index where the objects are ...
2
votes
0
answers
71
views
Data structure for storing classification of billions of 64-bit integers
I have a set of ~10.2 billion 64-bit elements that are:
Constant and known before compile time (so no insertion, deletion, or modification).
Classified into 3 categories, also constant and known ...
2
votes
1
answer
2k
views
Very fast hash table lookup in C (e.g. by MPH)
I need a very fast hash table in C (or C++). Conditions are like this:
There exist N known keys which shall map to an object (with some state)
There exist more unknown keys which do not map to ...
5
votes
2
answers
2k
views
Ultra fast lookup in small sized container of 64-bit integer values using dynamic perfect hashing
I have input keys that can cheaply be converted to a uint64_t (ie, the input contains less than or equal to 64 bits).
Each unique key (not yet in the map) will be assigned some data (a pointer to an ...
1
vote
2
answers
715
views
perfect hash function for random integer
Here's the problem:
X is a positive integer (include 0) set which has n different elements I know in advance. All of them is less equal than m. And I want to have an occ-free hash function as simple ...
0
votes
1
answer
3k
views
Is golang's native string hash function a perfect one?
I've found that function in the golang's source code and want to know whether it's truly a perfect hash function or not.
Is it the correct way to test that?
package main
import (
"fmt"
...
0
votes
1
answer
1k
views
Representation of graphs in a hash table
I'm currently writing my master thesis about clusterings in graphs. My prof said he wants the graph to be represented as a hash table. Because it needs less space than the adjency matrix and it is ...
0
votes
1
answer
256
views
Create a 'perfect hash function' for contiguous ranges
I'm looking for a way to 'project' a series of 'ranges' into a series of values. Applications would be histograms with uneven bins or creation of lookup tables.
An example:
0 to 14 => 0
15 to 234 =&...
0
votes
1
answer
138
views
How to use null bytes in gperf?
The gperf info pages claims that if you specify -l then
The keywords in the input file may contain NUL bytes, written in
string syntax as 000円 or \x00, and the code generated by gperf will
treat ...
1
vote
1
answer
670
views
31-bit Bijective (Perfect) Hash algorithm
What I need
I need an algorithm that produces a bijective output. I have a 31-bit input and need a pseudo-random 31-bit output.
What I have considered
CRCs are bijective within their bit-width.
I ...
15
votes
2
answers
8k
views
Is it possible to create a Minimal Perfect Hash function without a separate lookup table for a small (<64) set of keys?
I recently read this article Throw away the keys: Easy, Minimal Perfect Hashing about generating a minimal perfect hash table for a known set of keys.
The article seems to assume that you need an ...
1
vote
0
answers
40
views
Perfect hashing for permutations
Consider the following list of permutations of {0,1,2,3,4,5,6,*,*,*} as generated with ordinary backtracking:
Index Permutation
1. 0123456***
2. 012345*6**
3. 012345**6*
...