Questions tagged [string-hashing]
90 questions
1
vote
2 answers
Checking for string matches using hashes, without double-checking the entire string
I'm trying to check if two strings are identical as quickly as possible. Can I protect myself from hash collisions without also comparing the entire string?
I've got a cache of items that are keyed by a string. I store the hash of the string, the…

LightStruk
- 1,451
- 14
- 17
1
vote
2 answers
How Cassandra search on unique key of string?
I want to use string (almost around 6 to 7 characters approximately) as unique key in composite primary key.
I have googled if using string in primary key will hit performance or not and found that no it will not as Cassandra use hashing for…

Keval
- 1,857
- 16
- 26
1
vote
0 answers
How can I check file differences in JavaScript?
I'm using Electron, Githubs desktop framework built using JS and HTML 5. I need to check if fileA is different to fileB, and similarly with 2 strings.
These files and strings could be of equal size but be different. They could be small (2-3 bytes)…

Mike
- 8,767
- 8
- 49
- 103
1
vote
0 answers
Am I using MurmurHash2 correctly?
So i'm writing a hashing program for one of my classes and he's letting us find a hashing function online. However when I use the following hashing function I get huge numbers. My question is, do I have to mod the answer I get from this function…

Iriketurtles
- 33
- 5
1
vote
2 answers
How to pick same colors for same userid
I have a library in which a String userid is passed so basis on that String userid, I need to pick either one of these three colors only.
RED
BLUE
PINK
Let's say if String userid is 12345 then for example it can pick RED so next time if same userid…

user1950349
- 4,738
- 19
- 67
- 119
1
vote
0 answers
Extensible Hashing with unique keys
I have a database that consists of tuples like so
'The Abyss,1989,LaserDisc,Science Fiction,James Cameron,James Cameron,USA,20th Century Fox,$0.00'
I want to concatenate the movie title with the year to make the unique key for each bucket. But…

TylerC
- 19
- 4
1
vote
0 answers
What hash algorithm is appropriate for reducing key size
I have the need for storing key-value pairs, where the key is supposed to be unique. It will be both kept in-memory as well as in binary format on disk. The key is also part of a custom message protocol sent over TCP.
Was first thinking of not…

Daniel
- 8,133
- 5
- 36
- 51
1
vote
3 answers
mysql where clause on long strings makes the query too slow
I have created a mysql table which has the crime count, Crime description, Crime Category and address of crime. I have created some reports over this table. The user wants to have a search by address filter in the report. so we are going to be using…

Arif
- 377
- 2
- 5
- 21
1
vote
1 answer
What's the value range of String.GetHashCode?
What's the value range of String.GetHashCode()?
For random strings with different length, are their hash code value range different?
e.g.
There're 2 groups of random strings. Group 1 strings are of length 5. Group 2 strings are of length 10. Do the…

smwikipedia
- 61,609
- 92
- 309
- 482
1
vote
2 answers
Hashcode not hashing properly
I've written a hashcode function for this class and for some reason the hashmap is not properly recognizing when a key is actually present in the HashMap. (coordinates is a string)
@Override
public int hashCode() {
return…

Raul Puri
- 119
- 1
- 1
- 12
1
vote
1 answer
BCryptHelper.CheckPassword always returns false
I'm implementing password hashing using BCrypt, which should be pretty straight forward to use.
However when the password is checked against the hashed password using
BCryptHelper.CheckPassword(Password, hashedDBPassword)
this always return…

user3493049
- 83
- 1
- 1
- 9
1
vote
1 answer
Is using email hash as user id a good solution to ensure anonymity?
Imagine you want to create a "secure" messaging app which must comply to:
If someone has access to server databases, he/she can not identify the user from the field your using to substitute the normal username / email.
This solution seems…

marco alves
- 1,707
- 2
- 18
- 28
1
vote
2 answers
How do i program a Double hash implementation meant for strings?
Hello everyone first time here but i'd like to start by first asking if my understanding of double hashing is correct.
Double hashing works by first implementing a hash function then checking to see if that spot is open. if the current spot is not…

red ketchum
- 13
- 1
- 4
0
votes
1 answer
memory access violation error while compiling hashing algorithm
I am getting error while inserting strings to memory.
0xC0000005 access violation error.I tried to change my array size which cause to bad allocation.
int main part is only sending string words to insert function until file…

J.Sou
- 1
0
votes
0 answers
Why does cout fail to output strings sometimes, but printf has no problem?
Problem: when printing items in a hash table, non top-level items do not print correctly.
I add items line-by-line from a text file. First, number of lines are determined, and then, the hash table is constructed, with the size found in the first…

Adam
- 39
- 1
- 9