Skip to main content

Crate turbo_tasks_hash

Crate turbo_tasks_hash 

Source
Expand description

Hashing and encoding functions for turbopack.

An example use of this module is hashing a file’s content for cache invalidation, and encoding the hash to a base40 or hexadecimal string for use in a file name.

Structs§

ShaHasher
Xxh3Hash64Hasher
Xxh3Hash64 hasher.
Xxh3Hash128Hasher
Xxh3Hash128 hasher.

Enums§

HashAlgorithm

Constants§

BASE40_LEN_64
Number of base40 characters needed to represent a 64-bit value without information loss.
BASE40_LEN_128
Number of base40 characters needed to represent a 128-bit value without information loss.

Traits§

DeterministicHash
Signals the implementor can safely be hashed in a replicatable way across platforms and process runs.
DeterministicHasher
Signals the implementor can safely hash in a replicatable way across platforms and process runs.

Functions§

deterministic_hash
encode_base40
Encodes a 64-bit unsigned integer into a fixed-width 13-character base40 string.
encode_base64
Encodes a 64-bit unsigned integer into a base64 string (11 chars, no padding).
encode_base40_128
Encodes a 128-bit unsigned integer into a fixed-width 25-character base40 string.
encode_hex
Encodes a 64-bit unsigned integer into a hex string.
encode_hex_128
Encodes a 128-bit unsigned integer into a hex string.
hash_xxh3_hash64
Hash some content with the Xxh3Hash64 non-cryptographic hash function.
hash_xxh3_hash128
Hash some content with the Xxh3Hash128 non-cryptographic hash function.

Derive Macros§

DeterministicHash