Skip to main content

All Questions

Tagged with
-4 votes
4 answers
3k views

Time efficient way to count pairs in an array whose sum is divisible by a specific number?

Given an array of integers, we want to find how many explicit pairs can be made such that their sum is divisible by 60. The pairs are not necessarily non-unique. For example, let's say the input into ...
8protons's user avatar
  • 1,379
-3 votes
2 answers
1k views

Which hash algorithm is best for speed and identical hashes. (a lot of collisions)

I'm searching an existing hash function or trying to make a hash function that has a lot of collisions. Regularly a hash is used for it's ability to create unique hashes for hash tables or security ...
NS - Not the train's user avatar
6 votes
1 answer
3k views

Using PostgreSQL MD5 hash to calculate a 64 bit hash value for advisory lock functions?

I have a particular problem addressing the PostgreSQL advisory locking functions using the bigint variants. Basically I want to create a 64 bit bigint value from a text type obtained with the ...
πάντα ῥεῖ's user avatar
0 votes
0 answers
121 views

Searching/Hashing Wikipedia - at each position for keys 1..31 long, the fastest way?

A C coder here. My wish is to find the best way to search words and phrases within the ever-growing English Wikipedia XML dump. As a first layer/step, hashing is the answer, yes? The problem is that ...
Georgi's user avatar
  • 17
-2 votes
2 answers
1k views

What are some disadvantages for a hashmap with timestamp as key? [closed]

"What are some problems that can arise from using a HashMap with timestamp as keys"? I, for one, do not see any major issues with this kind of "setup". Is this "setup" a no-go/an anti-pattern/...
Belun's user avatar
  • 1,294
0 votes
1 answer
1k views

Distribute jobs evenly among a set of servers

I have the need to distribute a set of long running jobs across a cluster of containers in ECS. These jobs essentially would need to open a socket connection with a remote server and begin streaming ...
remarkpk's user avatar
0 votes
1 answer
521 views

A collision-free hash-like function for use in hash tables and other data structures?

A short introduction to the problem: I'm working with a small database where I have a table of strings (web URLs, to be precise) as pairs: hash|string. Another table references these strings by hash ...
Violet Giraffe's user avatar
2 votes
1 answer
642 views

Hashing tag list to perform faster search

I have a list of items. Each item have various properties. Each item can be tagged, like tagging a post here. Right now, tags are represented using a Tags property, that is a string and it looks like ...
BAD_SEED's user avatar
  • 267
-1 votes
1 answer
725 views

What is the SLOWEST 32 hashing function without excessive collisions

I am currently using a CRC32 hash to generate a locality sensitive hash for some of my data. For much the same reasons as PKBDF2 makes a better choice than, say, SHA26, for hashing passwords I ...
DroidOS's user avatar
  • 101
1 vote
1 answer
2k views

Reverse engineering a checksum or CRC

I am trying to reverse engineer a checksum or CRC wherein an 8 bit number* gets converted to a 5 bit number for error checking. I have an incomplete list of data values and checksums, and need to ...
DrWizard's user avatar
0 votes
3 answers
404 views

What can I infer from Hilbert's map?

How do I understand Hilbert's map in this answer? The author of the answer has mapped the hash value (integer) of some strings to a 2D image. I understand that Hilbert's curve is a technique for 1D &...
user3219492's user avatar
11 votes
6 answers
4k views

Is there an "anti-hash" or "similarity hash" / similarity measure algorithm?

The idea of hashes is they get drastically different results for even the smallest change of data. What I am asking for is the opposite of that. An algorithm that will produce proximity hash values ...
dtech's user avatar
  • 763
12 votes
3 answers
3k views

Is it possible to implement a well-distributed hash table without using the % operator?

I'm looking to implement a fast, well-distributed hash table in C#. I'm having trouble choosing my hash-constraining function that takes an arbitrary hash code and "constrains" it so it can be used to ...
James Ko's user avatar
  • 358
1 vote
0 answers
91 views

Consistent hash ring with subsets in different buckets

I have N buckets. I have M users. Each user can buy anywhere between 1 and N tickets to an upcoming lottery. I would like to distribute the tickets more or less evenly between the buckets, with the ...
Kevin Burke's user avatar
-1 votes
2 answers
2k views

How does Pearson hashing compare with other non-cryptographic hashing algorithms?

FNV-1, Murmur2, and DJB2 are examples of non-cryptographic hashing functions used in actual applications (see Which hashing algorithm is best for uniqueness and speed?). These are all similar in that ...
David Spector's user avatar

15 30 50 per page