Expand description
The hash extension module. It provides extra concepts like Fingerprint
and
HashedTrait
.
Structs§
- Archived
Fingerprint - An archived
Fingerprint
- Fingerprint
- See https://github.com/rust-lang/rust/blob/master/compiler/rustc_hir/src/stable_hash_impls.rs#L22 The fingerprint conflicts should be very rare and should be handled by the compiler.
- Fingerprint
Builder - A fingerprint builder that produces unique fingerprint for each item.
It resolves the conflict by checking the underlying data.
See
Fingerprint
for more information. - Fingerprint
Resolver - The resolver for an archived
Fingerprint
- Fingerprint
SipHasher - A fingerprint hasher that uses the
SipHasher13
algorithm. - FxHasher
- A speedy hash algorithm for use within rustc. The hashmap in liballoc by default uses SipHash which isn’t quite as speedy as we want. In the compiler we’re not really worried about DOS attempts, so we use a fast non-cryptographic hash.
- Hashed
Trait - A trait that provides a static prehashed 64-bit hash for any internal
T
.
Traits§
- Fingerprint
Hasher - A fingerprint hasher that extends the
std::hash::Hasher
trait. - Static
Hash128 - A trait that provides a static prehashed 128-bit hash.
Functions§
- hash32
- A convenience function for when you need a quick 32-bit hash.
- hash64
- A convenience function for when you need a quick 64-bit hash.
- hash128
- Calculate a 128-bit siphash of a value.
Currently, this function use
SipHasher13
as the underlying hash algorithm. - item_
hash128 - This function provides a hash function for items, which also includes a type
id as part of the hash. Note: This function is not stable across different
versions of typst-ts, so it is preferred to be always used in memory.
Currently, this function use
SipHasher13
as the underlying hash algorithm.
Type Aliases§
- Fingerprint
SipHasher Base - The base hasher for the
FingerprintSipHasher
. - FxDash
Map - A dashmap that uses the FxHasher as the underlying hasher.
- FxHash
Map - Type alias for a hash map that uses the Fx hashing algorithm.
- FxHash
Set - Type alias for a hash set that uses the Fx hashing algorithm.