hash package:github
Like
hashWithSalt, but no salt is used. The default
implementation uses
hashWithSalt with some default salt.
Instances might want to implement this method to provide a more
efficient implementation than the default implementation.
Return a hash value for the argument, using the given salt.
The general contract of
hashWithSalt is:
- If two values are equal according to the == method, then
applying the hashWithSalt method on each of the two values
must produce the same integer result if the same salt is used
in each case.
- It is not required that if two values are unequal according
to the == method, then applying the hashWithSalt method
on each of the two values must produce distinct integer results.
However, the programmer should be aware that producing distinct
integer results for unequal values may improve the performance of
hashing-based data structures.
- This method can be used to compute different hash values for the
same input by providing a different salt in each application of the
method. This implies that any instance that defines
hashWithSalt must make use of the salt in its
implementation.
- hashWithSalt may return negative Int values.
A map from keys to values. A map cannot contain duplicate keys; each
key can map to at most one value.
The class of types that can be converted to a hash value.
Minimal implementation:
hashWithSalt.
Hashable is intended exclusively for use in in-memory data
structures. .
Hashable does
not have a fixed standard.
This allows it to improve over time. . Because it does not have a
fixed standard, different computers or computers on different versions
of the code will observe different hash values. As such,
Hashable is not recommended for use other than in-memory
datastructures. Specifically,
Hashable is not intended for
network use or in applications which persist hashed values. For stable
hashing use named hashes: sha256, crc32, xxhash etc.
If you are looking for
Hashable instance in
time
package, check
time-compat