Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [hashing]

A hash function is any algorithm that maps data of arbitrary length to data of a fixed length. The values returned by a hash function are called hash values, hash codes, hash sums, checksums or simply hashes. From Wikipedia: http://en.wikipedia.org/wiki/Hash_function

0
votes
1answer
120 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 ...
1
vote
1answer
42 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 ...
3
votes
0answers
103 views

Hashing algorithm without the avalanche effect

I know that one of the most important features of hashing algorithms, is that minor changes in the input should reflect great change in the hash itself (the avalanche effect), but I'm currently ...
-1
votes
1answer
124 views

Logic Behind a Basic Hash Table Hashing Algorithm

I am trying to write a Hash Table in Java based on some Princeton article about it. The most commonly used method for hashing integers is called modular hashing: we choose the array size M to be ...
0
votes
0answers
156 views

Strategy regarding an (almost always) offline app

I'm currently in internship in a software/app development company, where I have to come up with an idea about how can we handle the fact that the user will mostly use an app offline. Basically, the ...
3
votes
3answers
602 views

What is an example for a one-way hash function?

I am doing a bit of research on hash functions. I understand the concept that it is an equation that is easy to do one way (you take the number 00011010 for example and do reasonably simple math with ...
-1
votes
1answer
131 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 ...
-1
votes
4answers
584 views

Why can't Dictionary(TKey, TValue) update it's hashcodes?

I've read that an object's hashcode should not change while it is part of a Dictionary. Because if it changed, there would be no way to find it in the Dictionary. Why doesn't the Dictionary class ...
0
votes
1answer
82 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 ...
0
votes
2answers
78 views

Hashable classes: Should I only keep the id's for results or entire class

Given 2 objects / classes: A class for a cargo ship. It has a small set of attributes, say current location, size, number of crew and some other things. Most important, it has an attribute for the id ...
-2
votes
1answer
155 views

How does Steam resume downloads without computing a partial hash?

The Steam Client application allows one to download games purchased through the associated Steam account. A typical modern game uses quite a bit of disk space (in the order of 50-70 GB), so it is not ...
0
votes
3answers
183 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 &...
1
vote
2answers
374 views

Map/store run time ID for objects

What I want to achieve: I need to obtain a run time (unique) id for "any object" (for classes either in java SE, classes I have created or classes provided by other third parties... any instance of a ...
5
votes
6answers
1k 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 ...
1
vote
0answers
158 views

Data structure for fast bi-directional SHA-1 to SHA-3 mapping

What data structure would be best choice for fast and performant bidirectional SHA-1 to SHA-3 mapping? Or in other words fixed-length string to fixed-length string mapping? To be more precise: ...
0
votes
3answers
135 views

algorithm for perfect substring temporarily replacement

I have an interesting question about string and delimiters. There is a random string str. There are some symbols (OR SEQUENCES OF SYMBOLS) that are predefined and should be temporarily replaced ...
1
vote
2answers
226 views

Why do we need datastructures other than HashMap

Map (or HashMap) takes Constant time for Insert, Remove and Retrieve. While all other data structures which I know so far, do not take constant time and their time for above operations depends on the ...
0
votes
0answers
116 views

Is my persistent storage strategy efficient for my project's objectives?

I am trying to build a key-value store (to learn, I am a student) that would serve as a persistence layer for software applications. I have looked into the database literature and dived a little bit ...
3
votes
1answer
229 views

When should a general purpose hash table assume hash equality implies logical equality?

For a general purpose hash table that aims for both high performance and correctness, when, if ever, does it make sense to assume that hash equality implies logical equality? To lay some ground rules ...
1
vote
1answer
1k views

If I am using just HashMap can I override only hashCode method?

If I need to use only HashMap, why do I need to override equals() method along with hashCode()? How will not implementing equals() affect the working of HashMap?
-3
votes
2answers
198 views

Which is the best hash algorithm considering uniqueness and slowness

I couldn't find an answer, so let's try here... I thought a bit about security and came to the conclusion, that the used hash algorithm should be as slow as possible, to slow potential attackers. (...
11
votes
3answers
1k 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 ...
0
votes
2answers
1k views

Best way to hash passwords in PHP?

I've switched to PHP 7.0 very recently and I was wondering that if password_hash was better than making your own salt and using the crypt function. I have three examples of code and I don't know which ...
0
votes
1answer
321 views

Secure communication between a mobile app and a microcontroller

I have a MCU-based design that essentially controls other hardware and this MCU is controlled through an app. I was hoping someone could help me figure out how to secure this communication between the ...
4
votes
1answer
138 views

Reproducible uniqueness

So, I have a bunch of calls that are all being generated with a UUID1 throughout the day. At the end of the call the call is processed and some metrics around that call are generated and stored in ...
2
votes
2answers
216 views

Does it make sense to check multiple hashes when detecting a file duplicate?

Please forgive me if this question belongs on different StackExchange site. A much more experienced colleague (like, 8 times more experienced than me) has vigorously defended an idea that you should ...
2
votes
2answers
117 views

How can I tell if a web sign up form actually encrypts my password?

Recently I signed up for new account for a service provider's web site. I entered the usual the name, email , password (strong) , repeat password and I was signed up. Great everything works well. A ...
1
vote
0answers
50 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 ...
0
votes
1answer
346 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 ...
0
votes
1answer
55 views

Hash system to generate same (specified) hash from multiple datasets?

I have a hashed value X and need to ensure that any of the data sets D1...Dn can be concatenated with a correctional value C1...Cn and passed into a hashing algorithm to result in the value of X. ...
0
votes
1answer
101 views

Efficient irreversible “serialization”?

Suppose we have a function f that gets a complex (non-flat) object as an input, serializes it, calculates hash of serialization results (e.g. md5) and returns calculated hash. It may use some exiting ...
1
vote
1answer
237 views

Hashing a tuple of maximum-valued integers

I'm considering a hash function for a tuple of and maximum-valued integers for example (3 ,2, 5 ) -- where each element of the tuple has some maximum value N. My plan is to treat the elements of the ...
0
votes
0answers
14 views

Partition stream of data between n servers, with m duplicates

I'm partitioning a stream of input data between n servers. The simple way of doing it is to use the hash of some property of each input data packet to assign a single server, using mod or similar, and ...
7
votes
1answer
631 views

What kind of members should be used in a GetHashCode() implementation

We're building some Roslyn analyzers concerning GetHashCode(), including an analyzer that implements it for you in a given class. While researching the subject we've found that there are many ...
-1
votes
2answers
107 views

Does sql use hastables for indexes? [closed]

Are there other ways of indexing?, Which are the more used? Does sql have an standard for indexes, it uses hash tables?
3
votes
1answer
170 views

Does murmur3 hash have memory?

This implementation of Murmur hash yields different results when called twice in a row: Murmur3 m3 = new Murmur3(); var la = m3.ComputeHash(new byte[] { 1, 2 }); var lb = m3.ComputeHash(new byte[] { ...
1
vote
3answers
592 views

How do I generate multiple hashes that can be resolved to a single value?

I need multiple "random" URLs that just mask the original URL, i.e.: /ABC /CBA /CAB All resolve to /6 I came up with matching a letter to a number and then you can sum them to the single value. A =...
-3
votes
2answers
212 views

How do you hash 4 doubles into a size_t?

I have bounding boxes the key type. Box { double mins[2]; double maxs[2]; } And I want to have Box as the key type in the D programming language, so I have to implement: size_t toHash() const @...
0
votes
1answer
103 views

Question on password hashing security

I'm about to add some user account and password functionality to my software, so I'm reading about password hashing. So my understanding is Hashing is a one way function, and it works like this: ...
1
vote
3answers
756 views

Why would I need `equals` if I have already `hashcode`?

I got a question about why we need equals if we have hashcode. My first attempt was the answer because collision. But we corrected starting point with the assumption that we have not many objects so ...
3
votes
1answer
829 views

Strategy for Public / Private API, Encrypted (or Hashed) Data, and Server Compromise

In this very simplistic but realistic scenario, I have 2 combo web/database servers (A) behind a load balancer and a single IP address. They also permit access only from one IP address -- the client (...
2
votes
2answers
639 views

ASP.NET storing encrypted & salted Password

I have a question about storing encrypted passwords in your database to help secure them. I have a class that encrypts the password passed in and returns a string. This string has 3 parts too it, all ...
-1
votes
1answer
135 views

What is the hash value of each member of the group? Before modding?

This isn't an actual code related question but it relates to C. We are given: Amy's club has grown and now includes the following members: Abel, Abigail, Abraham, Ada, Adam, Adrian, Adrienne, Agnes,...
5
votes
1answer
1k views

Why would a Rest Api demand a hash of the parameters?

I'm working with a Rest Api that demands to send with any request a hash of the parameters of the request: Hashkey Calculation This hash key has to be generated by the device itself and has to ...
22
votes
4answers
4k views

Why is the Git .git/objects/ folder subdivided in many SHA-prefix folders?

Git internally stores objects (Blobs, trees) in the .git/objects/ folder. Each object can be referenced by a SHA1 hash that is computed from the contents of the object. However, Objects are not ...
1
vote
0answers
455 views

Generate a fixed length number hash from a number

Let say I've a fixed length number, e.g. 6 digit: 837493, I want to apply some process (with a salt), and generate a new number of another 6 digits, e.g. number = 837493 another = hash(number + ...
4
votes
3answers
197 views

How to store (and find) updated values in a Distributed Hash Table?

Distributed Hash Tables are a great way to store immutable data in a resilient way. However, I am wondering about how it would be possible to store new versions of old data in this system. Because ...
1
vote
0answers
70 views

Metrics for when to use a hash value?

I am working on a project that requires a series of flat files. I will be doing some data checking against simple date like: ID;StatusCode So a typical file might be like: 13993;R 38293;A 19349;I ...
1
vote
0answers
65 views

Writing a container that treats nearly-identical images as the same

I want to create a mapping in Python that will use images as keys, but treat similar (but not identical) images as the same key. I have an approach for deciding which images are similar enough: I ...
1
vote
2answers
2k views

How to generate Generate Hash incorporating time stamp so it can be unhashed to get the timestamp when it was generated?

I want to create hash based on random id, That hash has to be valid for only 15 minutes. Is there a way to do that? I'm using this for form submission. If some unknown submitted form or some one ...