Helper class for computing hash values.
static class
|
HashCode
|
Computes a hash code for the given value.
[Pure]
|
||||
public
static
method
|
Float32
(float32 value,
int32 hash = 0)
|
|||
type
|
int32
|
|||
params
|
value
|
The value. | ||
hash
|
Previous
hash
code
to
combine
with.
Defaults
to
0 . |
|||
returns
|
The resulting hash code. |
Computes a hash code for the given value.
[Pure]
|
||||
public
static
method
|
Float64
(float64 value,
int32 hash = 0)
|
|||
type
|
int32
|
|||
params
|
value
|
The value. | ||
hash
|
Previous
hash
code
to
combine
with.
Defaults
to
0 . |
|||
returns
|
The resulting hash code. |
Computes a hash code for the given values.
[Pure]
|
||||
public
static
method
|
Hash
(int32 hash0,
int32 hash1)
|
|||
type
|
int32
|
|||
params
|
hash0
|
First hash code. | ||
hash1
|
Second hash code. | |||
returns
|
The resulting hash code. |
Computes a hash code for the given value.
[Pure]
|
||||
public
static
method
|
Int32
(int32 value,
int32 hash = 0)
|
|||
type
|
int32
|
|||
params
|
value
|
The value. | ||
hash
|
Previous
hash
code
to
combine
with.
Defaults
to
0 . |
|||
returns
|
The resulting hash code. |
Computes a hash code for the given value.
[Pure]
|
||||
public
static
method
|
Int64
(int64 value,
int32 hash = 0)
|
|||
type
|
int32
|
|||
params
|
value
|
The value. | ||
hash
|
Previous
hash
code
to
combine
with.
Defaults
to
0 . |
|||
returns
|
The resulting hash code. |
Computes a hash code for the given value.
[Pure]
|
||||
public
static
method
|
Obj
(object value,
int32 hash = 0)
|
|||
type
|
int32
|
|||
params
|
value
|
The value. | ||
hash
|
Previous
hash
code
to
combine
with.
Defaults
to
0 . |
|||
returns
|
The resulting hash code. |
Computes a hash code for the given value.
[Pure]
|
||||
public
static
method
|
ObjRef
(object value,
int32 hash = 0)
|
|||
type
|
int32
|
|||
params
|
value
|
The value. | ||
hash
|
Previous
hash
code
to
combine
with.
Defaults
to
0 . |
|||
returns
|
The resulting hash code. |
Determines whether a power-of-two sized hashtable should be grown in order to keep up good hashing performance.
public
static
method
|
ShallGrowHashtable
(int32 countUsedBuckets,
int32 countUsedNodes,
int32 capacity)
|
||
type
|
bool
|
||
params
|
countUsedBuckets
|
Number of used hashtable buckets. | |
countUsedNodes
|
Sum of number of linked nodes of all hashtable buckets. | ||
capacity
|
Capacity of the hashtable, in buckets. | ||
returns
|
true
if
the
hashtable
should
be
grown,
false
if
not. |
Computes a hash code for the given value.
[Pure]
|
||||
public
static
method
|
Str
(string value,
int32 hash = 0)
|
|||
type
|
int32
|
|||
params
|
value
|
The value. | ||
hash
|
Previous
hash
code
to
combine
with.
Defaults
to
0 . |
|||
returns
|
The resulting hash code. |
Remarks:
The method will always produce the same hash code for the same string value, independently of the programming language or runtime environment (e.g. DOT.NET 32-bit vs. 64-bit).