1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! This module contains functions to calculate the digest of a file.
//!
//! The digest is calculated using the SHA256 algorithm.
use crateOneIoError;
use ;
/// Calculate the SHA256 digest of a file.
///
/// This function takes a path to a file as input and returns the SHA256 digest of the file
/// as a hexadecimal string. Supports both local files and remote URLs (HTTP, HTTPS, FTP, S3).
///
/// Note: This function computes the hash of the raw file bytes without any decompression,
/// even if the file has a compression extension (e.g., `.gz`, `.bz2`).
///
/// # Arguments
///
/// * `path` - The path to the file. Can be a local file path or a remote URL.
///
/// # Returns
///
/// Returns the SHA256 digest as a hexadecimal string, or an error if the file cannot be read.