Most voted "hashcode" questions
Hash code is the result of the application of a data hash function, usually an integer number.
Learn more…8 questions
Sort by count of
-
14
votes1
answer356
viewsWhat would be a good hash calculation algorithm to use in a scattering table?
In the question Why String hashcode() in Java uses 31 as multiplier? There is talk of the use of the number 31 as a multiplier. There has been a controversy about the motivation of this number. In…
-
13
votes1
answer14872
viewsWhat is Hashcode and what is its purpose?
I have observed that the use of hashcode is used in comparisons, but what does the term mean? Its use in programming is specific in comparison?
-
9
votes2
answers2912
viewsWhat is the purpose of the Gethashcode() method?
I’m using Resharper to automate the method override Equals and the operator ==. One of the methods the tool has overwritten is GetHashCode: public override int GetHashCode() { unchecked { return…
-
7
votes2
answers339
viewsWhy does String hashcode() in Java use 31 as a multiplier?
In Java, the code hash for an object String is computed as s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1] using integer arithmetic, where s[i] is the i-nth character of the string, n is the string…
-
4
votes2
answers830
viewsWhat is the most efficient way to calculate the Hashcode of an object in Javascript?
I’m currently using Object.prototype.GetHashCode = function () { var s = this instanceof Object ? JSON.stringify(this) : this.toString(); var hash = 0; if (s.length === 0) return hash; for (var i =…
-
1
votes2
answers346
viewssave a data type in a file in c
I have this data structure: typedef struct { ListaCartao tabelaCartao[HASHSIZE]; ListaArtigos tabelaArtigos[HASHSIZE]; char localidade[MAXLOCALIZACAO]; }tCelulaSuperdume, *SuperDume; SuperDume…
-
1
votes2
answers162
viewsEquals() and Hashcode() superscript
I’m learning to use the equals() and hashCode(), and I was taught that Eclipse overwrites this method for us. But I’m trying to buy two attributes to tell if one object is the same as the other.…
-
0
votes1
answer793
viewsHow to check whether the list is empty or with an element in C
typedef struct { int tamanho; nodo *inicio; } lista; typedef struct { lista **vet; int tamTabHash; int colisoes; } tabHash; tabHash…