hash_enricher.hash_enricher#

Hash Enricher for generating cryptographic hashes of media files.

The HashEnricher calculates cryptographic hashes (e.g., SHA-256, SHA3-512) for media files stored in Metadata objects. These hashes are used for validating content integrity, ensuring data authenticity, and identifying exact duplicates. The hash is computed by reading the file’s bytes in chunks, making it suitable for handling large files efficiently.

Module Contents#

class hash_enricher.hash_enricher.HashEnricher#

Bases: auto_archiver.core.Enricher

Calculates hashes for Media instances

enrich(to_enrich: auto_archiver.core.Metadata) None#

Enriches a Metadata object with additional information or context.

Takes the metadata object to enrich as an argument and modifies it in place, returning None.

calculate_hash(filename) str#