integer-hashing is used in its general meaning, so you are encouraged to use one or more tags to describe your situation better.
Questions tagged [integer-hashing]
15 questions
10
votes
1 answer
Is it possible to implement universal hashing for the complete range of integers?
I am reading about Universal hashing on integers. The prerequisite and mandatory precondition seems to be that we choose a prime number p greater than the set of all possible keys.
I am not clear on this point.
If our set of keys are of type int…

Cratylus
- 52,998
- 69
- 209
- 339
10
votes
5 answers
Hashing a set of integers in an order independent way
I want to hash a set of integers such that the order of the integers don't have an effect on the computed hash value. i.e. H([32224,12232,564423]) == H([564423,32224,12232]).
The number of unique sets will be in the range of a few millions. Speed…

jeffreyveon
- 13,400
- 18
- 79
- 129
7
votes
3 answers
How to look up range from set of contiguous ranges for given number
so simply put, this is what I am trying to do:
I have a collection of Range objects that are contiguous (non overlapping, with no gaps between them), each containing a start and end int, and a reference to another object obj. These ranges are not…

IgnisFatuus
- 1,998
- 1
- 12
- 8
4
votes
1 answer
python: Find matching tuples in the list
What is the quickest way to find matching 2-tuples in another list of 2-tuples?
The following codes looks extremely inefficient.
loc1 and loc2 are list of tuples of (x,y) coordinates.
loc3=[]
for loc in loc1:
if loc in loc2:
…

notilas
- 2,323
- 4
- 23
- 36
2
votes
4 answers
Java Hashcode gives integer overflow
Background information:
In my project I'm applying Reinforcement Learning (RL) to the Mario domain. For my state representation I chose to use a hashtable with custom objects as keys. My custom objects are immutable and have overwritten the…

Floris Devriendt
- 2,044
- 4
- 24
- 34
2
votes
1 answer
Debug Assersion Failed
I am attempting to create my own hash class for a school assignment, but after getting part of the way there I am stuck on an error that I haven't been able to debug.
When I run my project I get a "Debug Assertion Failed!...Expression: invalid null…

Zzz
- 2,927
- 5
- 36
- 58
2
votes
3 answers
Collision Checking in Hashing
I am having some understanding problem with Hashing concept as follows:
Suppose, I have implemented hash table(1-D array, say A[100]) having keys as numbers. I have one simple hash function H(Key) % Table_Size, which will return target index into…

Hitein
- 21
- 3
1
vote
3 answers
Hash function - two different meanings?
when we say hash function, I find it means converting a sequence bytes of keys to 32bit or 64bit unsigned integer in most articles,for example see this
However, when you implement hash_table, it looks like that hash function means converting a very…

Chang
- 3,953
- 2
- 30
- 43
1
vote
5 answers
How to compute a unique 'signature' for a list of numbers?
Given a list of numbers, for example some unique integer or long ID's what would be an optimum way to compute a reproducible 'signature' (preferably irregardless of element order)?
The use case is to detect whether any of the IDs have been added or…

ccpizza
- 28,968
- 18
- 162
- 169
1
vote
0 answers
How to ensure that an assignment of an int64 var to an int32 var wraps (c++/ c11)
Background
I use a small static hash table (linear probing) which I need in a stage in a OpenGL rendering pipeline, where I must retrieve and update int64_t type keys and some data as fast as possible. In short, this stage is about translating large…

benjist
- 2,740
- 3
- 31
- 58
1
vote
2 answers
storing highly sensitive data in sql server
I've been looking for finding the best solution to store highly sensitive information like an Amount or a balance in a banking application. Can I store that just as a numeric field or Do I need any encryption to encrypt that data? Am a bit worried…

Sandeep Thomas
- 4,303
- 14
- 61
- 132
1
vote
2 answers
Java: Need help on hashing function overflow
I am working on an assignment were I have to hash 10,000 numbers into a hash table of load size .1, .2 .3 .... up to .9. My problem is that my hashing function is giving me some overflow or something of the sort. If am doing a hash for a table with…

Will Lewis
- 95
- 1
- 6
0
votes
3 answers
what would be a good hash function for an integer tuple?
I have this class...
public class StartStopTouple {
public int iStart;
public int iStop;
public int iHashCode;
public StartStopTouple(String start, String stop) {
this.iStart = Integer.parseInt(start);
this.iStop =…

Hristo
- 45,559
- 65
- 163
- 230
0
votes
0 answers
Hashing a 64-bit value into a 32-bit MAC address
I'm looking into suggestions on how to convert a 64-bit die revision field into a 32-bit MAC address I can use a for a wireless application to avoid collisions.
The die information is
struct {
uint32_t lot;
uint16_t X_coordinate;
uint16_t…

Mark Lakata
- 19,989
- 5
- 106
- 123
-3
votes
2 answers
How to give Integer values in HashMap?
In hashmap how to give Integers in below form repersentation.i tried but i can't get solution.
(1,2)=17;

user306128
- 101
- 4