Module hash

Source
Expand description

The hash extension module. It provides extra concepts like Fingerprint and HashedTrait.

Structs§

ArchivedFingerprint
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.
FingerprintBuilder
A fingerprint builder that produces unique fingerprint for each item. It resolves the conflict by checking the underlying data. See Fingerprint for more information.
FingerprintResolver
The resolver for an archived Fingerprint
FingerprintSipHasher
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.
HashedTrait
A trait that provides a static prehashed 64-bit hash for any internal T.

Traits§

FingerprintHasher
A fingerprint hasher that extends the std::hash::Hasher trait.
StaticHash128
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§

FingerprintSipHasherBase
The base hasher for the FingerprintSipHasher.
FxDashMap
A dashmap that uses the FxHasher as the underlying hasher.
FxHashMap
Type alias for a hash map that uses the Fx hashing algorithm.
FxHashSet
Type alias for a hash set that uses the Fx hashing algorithm.