moveshelf_api.utils package

Submodules

moveshelf_api.utils.hash module

Hash utility functions for file integrity verification.

This module provides functions for calculating various hash checksums of files and data streams, optimized for handling large files common in motion capture workflows.

moveshelf_api.utils.hash.calculate_file_crc32c(file_path: str) str[source]

Calculate the CRC32C checksum of a file.

Parameters:

file_path – The path to the file to calculate the checksum for.

Returns:

The Base64-encoded CRC32C checksum.

moveshelf_api.utils.hash.calculate_file_md5(file_path: str) str[source]

Calculate MD5 hash of a local file using chunk reading.

Uses chunk reading to avoid loading large files entirely into memory, which is crucial for motion capture files that can be several GB in size.

Parameters:

file_path – Path to the file to calculate MD5 for.

Returns:

Hexadecimal string representation of the MD5 hash.

moveshelf_api.utils.hash.calculate_stream_md5(response) str[source]

Calculate MD5 hash of a streaming HTTP response using chunk reading.

Uses chunk reading to avoid loading large downloaded files entirely into memory, which is crucial for motion capture files that can be several GB in size.

Parameters:

response – urllib3 HTTPResponse object with preload_content=False.

Returns:

Hexadecimal string representation of the MD5 hash.

Module contents