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

How to generate a string hash, with a custom alphabet and length, while minimizing collisions

Assume I need to generate the hash for a string where the hash itself can be max N characters long in a given alphabet, e.g. all alphanumeric characters [a-zA-Z0-9] plus the symbols !?-=. One trivial approach would be to use well-known hash…
Marco Ancona
  • 2,073
  • 3
  • 22
  • 37
0
votes
1 answer

difference in time complexity using set's in method and list indexing(python)

I'm doing PS on this problem you can see this problem in english by clicking button in top right corner(right after star shape) problem Explanation: A single-player game is played on a rectangular board divided in R rows and C columns. There is a…
YSEO
  • 101
  • 7
0
votes
1 answer

Trouble understanding the solution to this double hashing problem

I am having trouble understanding the third question about double hashing at the link below http://www.cs.cmu.edu/~cburch/211-fa97/review/q-hash/index.html Here is the question, In the following, say our hash function for n is n % 20 and our…
madlee
  • 11
  • 2
0
votes
0 answers

In a hash table, how would I calculate the number of collisions?

So far I have a list of how many times each hash value is repeated. However, when I sum all the repeated values together it ends up just being the total number of values in the dataset. So how would I count the number of collisions in the data…
0
votes
1 answer

Hash Table separate chaining restore insertion order after removal

Is it possible to restore the insertion order of elements to the Hash Table with separate chaining collision resolution while preserving O(n) removal time complexity? For example, I store Linked Lists in an array. On each insertion, I calculate the…
0
votes
3 answers

What is a propper way of calculating the size of a hash table

I am bullding a hash table using double hashing to solve collision. How can I know what is the propper size? I know it has to prime to minmize the number of collisions.
0
votes
1 answer

Hash and reduce to bucket algorithm

The problem We have a set of symbol sequences, which should be mapped to a pre-defined number of bucket-indexes. Prerequisites The symbol sequences are restricted in length (64 characters/bytes), and the hash algorithm used is the Delphi…
πάντα ῥεῖ
  • 1
  • 13
  • 116
  • 190
0
votes
1 answer

Trucating FNV hash

I'm using 32-bit FNV-1a hashing, but now I want to reserve one of the bits to hold useful information about the input key. That is, I want to use only 31 of the 32 bits for hash and 1 bit for something else. Assuming FNV is well distributed for my…
codechimp
  • 1,509
  • 1
  • 14
  • 21
0
votes
1 answer

What are some ways to prevent deliberate malicious attacks against hash function implementations?

Say you have some software server that uses hash functions and some external source wants to exploit that and it keeps attacking the server using keys that they know (or with high probability) will result in collisions. How would you prevent this in…
user5965026
  • 465
  • 5
  • 16
0
votes
1 answer

Does Murmurhash have collisions on 32-bit inputs?

Consider the standard Murmurhash, giving 32-bit output values. Suppose that we apply it on 32-bit inputs -- are there collisions? In other words, does Murmurmash basically encodes a permutation when applied to 32-bit inputs? If collisions exist, can…
M A
  • 209
  • 2
  • 7
0
votes
1 answer

How collisions are handled in java LinkedHashMap?

I know that in HashMap collisions are handled using LinkedList at each index if there is a collision the new node is inserted at the end of LinkedList but in the case of LinkedHashMap we use a doubly-linked list but to maintain order here the next…
0
votes
1 answer

Custom key generation and collision in a hashMap

I have a method that is expected to save an object in a hashmap (used as a cache) that has as a key a String. The objects that are passed in the method have either fields that are “volatile” i.e. they can change on a next refresh from the data store…
Jim
  • 3,845
  • 3
  • 22
  • 47
0
votes
2 answers

A hash collision just happened

A smart contract address (0xc3ba5050ec45990f76474163c5ba673c244aaeca) generated in the Remix IDE on my local machine matches with an EOA (0xc3ba5050ec45990f76474163c5ba673c244aaeca) on Rinkeby in a transaction that happened 18 days ago. What is the…
Maxareo
  • 275
  • 2
  • 12
0
votes
1 answer

What should I do if primary or secondary clustering occurs in hash table

I get what primary and secondary clustering are but how to get rid of what way to minimise them properly
0
votes
1 answer

Are SHA1 collisions feasible due to the hash length, or the algorithm?

SHA1 creates a 20-byte hash SHA256 creates a 32-byte hash If I used only the first 20 bytes of SHA256, would it have the same collision resistance as SHA1, or is the weakness of SHA1 purely in the hash length and not the algorithm?
StampyCode
  • 7,218
  • 3
  • 28
  • 44