Questions tagged [hashcode]

A hash code is a result of applying a hash function to data, usually resulting in an integer.

2025 questions
0
votes
1 answer

Google add #gref hash to url

I have a content website. I search recipe or content in Google like this "manti tarifi" and when I click the link on Google. Google adding #gref hash.. What is the this #gref and how can I remove this hash from the url? SS ->…
Hakan
  • 1,199
  • 1
  • 14
  • 18
0
votes
0 answers

After serialization, Hashcode changed for an Object which is used as a HashMap key

I have a PaymentPreference class which has a hashmap to store all paymentmethods opted by consumer while he created his profile. This PaymentMethod is another class whose object are stored in this PaymentPreference hashmap as key and a Boolean…
rjb007
  • 11
  • 3
0
votes
1 answer

Create key via SQL and C# for partition key

I have a set of data which has a hierarchy of 3 levels. Each level has a name. I am looking at combining all of these names into a single string then creating a numeric hash that can be used as a hash key for a service fabric stateful service. I…
Paul
  • 2,773
  • 7
  • 41
  • 96
0
votes
4 answers

is there hash code / Heap address for primitive types in Java?

I was trying to find some approximization to address on heap , and you guys gave me the function System.IdentityHashCode(Object). The problem is - this function doesn't fit for primitive types. I'll explain why. I'm given as input Java compiled…
RanZilber
  • 1,840
  • 4
  • 31
  • 42
0
votes
3 answers

Why does Object.equals(Object o) require Object.hashCode() in java?

I have a list of objects of type Person and I want to get rid of elements that have the same name, using streams. I have found on the internet a suggestion to use a Wrapper class and my code looks like this so far: List people =…
hdw3
  • 871
  • 10
  • 28
0
votes
1 answer

Does Java hashCode method do both conversion and compression?

In other words, is the integer returned by hashCode() already an index to an entry of a hash table or does it have to go one step further by compressing itself to an index (by mod the table length maybe)?
0
votes
1 answer

How to hash/encrypt a string to protect private information but still make the string comparable

Given a string how to create a unique identifier / hash for that string so that one can track the occurence of the string without actually logging the original string. For example a URL "www.mylittlesecret.com" should show up as "xyz123" (hascode…
Cilvic
  • 3,417
  • 2
  • 33
  • 57
0
votes
1 answer

Hashcode for 3 int without collisions

Can you help me to find the best way to calculate hashcode for the class that has 3 int params (let say a, b, c) and each param may have values in the predefined range? I mean that a should be in some range from a1 to a2, b correspondingly from b1…
Bizon4ik
  • 2,604
  • 4
  • 20
  • 46
0
votes
0 answers

Java hashcode brute-forcing

I am new at Java programming. So i need your help. how can i decrypt a String.hashcode() to string again? Brute forcing? public class flag { public static boolean isFlag(String str) { return str.hashCode() == 1471587914 &&…
Atilla
  • 59
  • 1
  • 6
0
votes
1 answer

Search over 1 million loaded SQL rows using binary search tree

My app written in C# and loads over 1 milion rows from database. For some reason, I have to perform this initial loading and then I'll search inside the loaded rows instead of querying SQL and every single column has large data( about 500 characters…
Little Elite
  • 65
  • 13
0
votes
3 answers

I'm confused how hashcode and equals worsk - Why two objects created with the same parameters are not equal each other?

I'm working on deeper understanding of Java and I was experimenting with comparing the same objects. I have created two string objects with the same value, but assigned to different variable. It turned out that they have the same hash codes. After…
s-kaczmarek
  • 161
  • 1
  • 13
0
votes
0 answers

Is temporarily overriding equals method possible?

Is there a way to temporarily override hashcode and equals in java ? I have a User class with id, name and age attributes. The current equals compares the id, rightly so. So if two ids, are same then the Users are equal. Now, I have two Lists of…
happybuddha
  • 1,271
  • 2
  • 20
  • 40
0
votes
1 answer

Java's hashSet handling mult items with same hashcode

I couldn't find an answer to this question anywhere. I added 100,000 different strings with the same hash code to a HashSet in java, and it took 63 ms. (Linked List took 37373 ms) I was wondering how Java's hashSet handles this situation. (It was a…
0
votes
0 answers

Data structure for indexing application?

ok so I have this geek question that is must be debatable. If I have a web page and want to count how many words repeated and how its long? for example: " java is a great.... bla bla bla" ... "java is ...bla bla bla" Now, I have 7 … …
0
votes
0 answers

Is there any chance for the hash codes of two different objects of being same?

The collection frameworks like HashSet, HashMap, HashTable call hashCode() and equals() in order, to check the two objects are same(For reference, the language I'm learning is java). However if the return values of hashCode() are the same, how could…