Questions tagged [hash-collision]

a situation that occurs when two distinct pieces of data have the same hash value, checksum, fingerprint, or cryptographic digest.

See also the wiki tag.

233 questions
0
votes
1 answer

Does the length of the text to be hashed affect the probability of a collision?

I want to make unique code with sha1 with unique salt (definitely unique because i use id from table). I need unique code with 7 character but i can't use id from my table because it's more than 7 character. So i think it's better to use sha1 and…
0
votes
0 answers

Hashtable using byte[] as key is not detecting duplicate keys

Background I've got some files that I'm running hashes on and I need to know if those files exist already or not. I'm storing the hashes (as a byte digest Byte[]) and file path (as a Path) in a hashtable to make this quick and so I can print a…
Kelly Bang
  • 727
  • 6
  • 16
0
votes
4 answers

HashMap collisions: is my code correct?

I want to have one DateWrapper - representing a date (built for Hibernate persistance, but this is another story) - at most existing at the same time for the same date. I'm a bit confused about collisions and good keys for hashing. I'm writing a…
cdarwin
  • 4,141
  • 9
  • 42
  • 66
0
votes
1 answer

CRC32 Collision Probability

I've done quite a bit of checking up on other questions and I'm still uncertain on the issue. Here's my usage case: I have an online shopping cart. Occassionaly, certain clients find the ordering process either too tedious, or there are some clients…
StuyvesantBlue
  • 135
  • 1
  • 15
0
votes
1 answer

Hash Table that tries to hash Strings uniformly?

I am currently in a Data Structures course nearing the end of the semester, and have been assigned a project in which we are implementing a Linked Hash Table to store and retrieve keys. We have been given a pretty large amount of freedom with how we…
Kavix0
  • 21
  • 1
  • 1
  • 4
0
votes
5 answers

How to make a key have multiple values in a Hashtable?

I have 100 entries and I have to have to hash these into a hashtable of a limited size. I know how to work with the first entry, ht.put(k,v) does the trick. But as soon as I want to add another value to it, the old one gets overwritten. I don't want…
Mayur Tolani
  • 1,458
  • 3
  • 17
  • 28
0
votes
1 answer

What is the collision resolution mechanism for v8's associative array?

Which mechanism does it use form the following? https://en.wikipedia.org/wiki/Hash_table#Collision_resolution
Novellizator
  • 13,633
  • 9
  • 43
  • 65
0
votes
1 answer

Is it possible to have MD5 & SHA-0 Collisions both at the same?

I was studying about MD5 collisions and found that collisions were also found in SHA-0. Now, Is it possible to have MD5 and SHA-0 colliosion in two Strings or Files at once? Here is an image showing a comparison table which i found while…
Pravesh Agrawal
  • 869
  • 1
  • 11
  • 27
0
votes
2 answers

What hash function produces the maximum number of collisions when hashing n keys?

My question has to do with collisions. What is the maximum number of collisions that may result from hashing n keys? I believe you would be able to find this by taking n-1. But I am unsure if this is correct. I'm specifically trying to figure out a…
mm19
  • 87
  • 1
  • 10
0
votes
1 answer

Java HashTable Implementation get method returning null?

So I need to write this program that receives 17 files that contain NFL team names and scores (like one file contains scores for all 32 teams, while another file may contain 30 different scores for 30 of the same teams, but omitting two teams of…
0
votes
1 answer

How do I figure out how many buckets are required for a Hash table based on the number of elements?

Lets say I'm creating a hash between 7 and 8 million elements using linear probing to handle collisions. How do I figure out how many buckets are required?
kiyo
  • 41
  • 4
0
votes
1 answer

Confusion about linear probe method based Open Addressing in hashtables?

Suppose array index according to hashing function for string "temp" is 155 and location 155 is pre-occupied then location 156 is tried. Suppose location 156 is available, so this entry is saved in location 156 instead of 155. Later I find another…
understack
  • 11,212
  • 24
  • 77
  • 100
0
votes
1 answer

Hash functions violating some pre image properties

Suppose H(xy) = H(x) * H(y) . Clearly preimage properties are violated. How can we find x, y such that H(x) = H(y) mod (2^k)
0
votes
1 answer

HashMap Collision Handling

I am using other posts to work on hashMap Collision handling and people seem to say that the Java HashMap class already has collision handling... It doesnt seem to be working for me! Is there anyway to make my own collision handling? Heres my code! …
Joseph
  • 1
0
votes
0 answers

Keeping track of Collisions per index in an array-based hash table, as well as which values resulted in a collision using OPEN ADDRESSING ONLY

Sorry for the wordy title but it explains my question pretty well. I am working on an assignment in Java where I need to create my own Hash Table. The specifications are such that I must use an Array, as well as open-addressing for collision…
waffledave
  • 35
  • 9