A hash code is a result of applying a hash function to data, usually resulting in an integer.
Questions tagged [hashcode]
2025 questions
0
votes
1 answer
Maximum length of SSDEEP hash algorithm's result
I can't find any information about the maximum length of a hash value calculated with the ssdeep hash algorithm.
I want to store a ssdeep hash value inside a database by its hex digest represantation, but therefore I need to specify the length of…

winklerrr
- 13,026
- 8
- 71
- 88
0
votes
0 answers
HashCode for a recursive linkedList
I'm trying to write an hashCode for a class that is similar to a LinkedList but managed in a recursive way, I kinda write a method but I don't think it's the most precise way to write the hashcode in a recursive way.
Any suggestions?
Do you think…

Andreascopp
- 73
- 8
0
votes
1 answer
System.identityHashCode() behavior on primitives
In jvm imgui, I was using
System.identityHashCode(i++)
where
var i = 0
to generate for each frame always a constant id for a given object (and so being
able to track it)
However, one user case just showed me that this is valid only for values in…

elect
- 6,765
- 10
- 53
- 119
0
votes
1 answer
The hashCode for String versus other class objects
class Employee {
String name;
Employee(String name) {
this.name = name;
}
// hashCode method is not overridden
}
public class HashCodeConfusion {
public static void main(String[] args) {
Employee emp = new Employee("ABC");
…

Mill Hosper
- 39
- 4
0
votes
1 answer
What should be size of map if different objects(say 3) have same hash code, and as a result, present in same bucket?
What should be size of map if different objects(say 3) have same hash code, and as a result, present in same bucket?

nitz
- 27
- 4
0
votes
1 answer
Custom hashcode and comparator for the same map?
I need to implement a Map which must have a custom hash (returns an integer- year + car model number) and it also has to be sorted in decreasing order. If I use a TreeMap, I cannot make a custom hash, and if I use a HashMap, I cannot order it. How…

Jay_Peters
- 101
- 1
- 3
- 11
0
votes
0 answers
hashCode method implementation do not display equals JTextField
I have created a class that inherits from JTextField. The instance of this class should be stored into a Hashtable, it also can store a JTable so the declaration is Hashtable .
When I use the method hashCode() the JTextFields disappear except the…

blob
- 439
- 8
- 21
0
votes
0 answers
HashCode alteration upon insertion of data into hashMap
I have an implementation of a hashMap. When calling the get() function, which returns the associated value of the input key, if it exists, iterates through the map to see if it can find an entry with a key that are equivalent to the input and also…

rubyquartz
- 319
- 1
- 2
- 11
0
votes
1 answer
Implementing a generic map using a hash table in Java
Post Details
In a data structures course, I was given Java source code for a "quadratic probing hash table" class and asked to implement a generic map (with get and put methods) and store the key/definition pairs in a hash table. I understand the…

chatblanc
- 1
- 1
0
votes
2 answers
How objects are compared in java?
So for a long time i thought that objects are compared using equals() which uses hashcode() , which means if 2 objects have same hash code it returns true.
The equals() method from source code:
@see java.lang.System #identityHashCode
public boolean…

Bishop
- 3
- 3
0
votes
2 answers
Contract Checking in Java - In Built? E.g. Hashcode/Equals
Is there any in-built contract checking in Java e.g. for the contract between a hashcode and the equals function?
For this question, let's stick with the hashcode/equals contract as an example, but I'm interested in contract checking in general. I…

Colm Bhandal
- 3,343
- 2
- 18
- 29
0
votes
0 answers
Resizing HashMap
I created a HashMap to store entries. Now when there is a collision of hashcodes, how can I resize the buckets. Right now I just have the buckets set to an arbitrary prime number and I can't figure out how to make the buckets resize themselves if…

Ryan Higgs
- 9
- 2
0
votes
1 answer
What is a good way to separate population for A/B experiment?
The individuals are given as GUIDs and I need to split them by a criterion into A/B to run experiments. What is a good function for spreading them into equal buckets?

Andrei
- 13
- 3
0
votes
1 answer
e.keyChar does not work for Ctrl
This code shows hashcodes of pressed button, but when i press on Control button i does not do anything. Can help me someone?
private void treeView1_KeyPress(object sender, KeyPressEventArgs e)
{
…

Irakli Lekishvili
- 33,492
- 33
- 111
- 169
0
votes
2 answers
Comparing two entities with Set inside with java
I have entity with Set inside
class A {
public Set b;
}
When I'm trying to compare two entities A I have a problem with how to compare Set b with Set b fields. hashCode and equals are overrided automatically but they didn't compare correctly.…

Bohdan Myslyvchuk
- 1,657
- 3
- 24
- 39