Module digest

Source
Expand description

Utilities for computing digests used by the Wayback Machine.

The Wayback Machine’s CDX index provides a digest for each page in its search results. These digests can be computed by

Functions§

bytes_to_string
Encode a SHA-1 hash into a 32-character Base32 string.
compute_digest
Compute the SHA-1 hash for bytes read from a source and encode it as a Base32 string.
compute_digest_gz
Compute the SHA-1 hash for bytes read from a GZip-compressed source and encode it as a Base32 string.
string_to_bytes
Decode a Base32 string into the SHA-1 bytes, returning an empty value if the input is not a valid Base2-encoded SHA-1 hash.