Skip to main content

hash_files_async

Function hash_files_async 

Source
pub async fn hash_files_async(
    file_paths: Vec<String>,
) -> Result<Vec<XetFileInfo>>
Expand description

Computes xet hashes for multiple files in parallel without uploading.

This function processes multiple files concurrently using a semaphore to limit parallelism. Each file is hashed independently using hash_single_file(). The resulting hashes are identical to those from upload operations, enabling validation and verification of file transfers.

§Arguments

  • file_paths - Vector of file paths to hash

§Returns

  • Vector of XetFileInfo in the same order as input file paths

§Errors

  • Returns error if any file cannot be read or hashed

§Use Cases

  • Verify integrity of downloaded files by comparing computed hashes
  • Batch validation of multiple files after transfer
  • Determine which files need to be uploaded by comparing with server hashes

§Performance

  • Uses file_ingestion_semaphore to control parallelism
  • No authentication or server connection required
  • Pure local computation