pub(crate) fn file_hash(
    path: &Path,
    offset: FilePos,
    len: FileLen,
    buf_len: usize,
    cache_policy: Caching,
    progress: impl Fn(usize),
) -> io::Result<FileHash> {
    let mut file = open(path, offset, len, cache_policy)?;
    let hash = stream_hash(&mut file, len, buf_len, progress)?.1;
    evict_page_cache_if_low_mem(&mut file, len);
    Ok(hash)
}
/// Computes hash of initial `len` bytes of a file.
/// If the file does not exist or is not readable, print the error to stderr and return `None`.
/// The returned hash is not cryptograhically secure.
Computes hash of initial `len` bytes of a file.
If the file does not exist or is not readable, print the error to stderr and return `None`.
The returned hash is not cryptograhically secure.
Computes hash of initial ` len ` bytes of a file . If the file does not exist or is not readable print the error to stderr and return ` None ` . The returned hash is not cryptograhically secure .
pub(crate) fn file_hash(
    path: &Path,
    offset: FilePos,
    len: FileLen,
    buf_len: usize,
    cache_policy: Caching,
    progress: impl Fn(usize),
) -> io::Result<FileHash> {
    let mut file = open(path, offset, len, cache_policy)?;
    let hash = stream_hash(&mut file, len, buf_len, progress)?.1;
    evict_page_cache_if_low_mem(&mut file, len);
    Ok(hash)
}
pub ( crate ) fn file_hash ( path : & Path , offset : FilePos , len : FileLen , buf_len : usize , cache_policy : Caching , progress : impl Fn ( usize ) , ) -> io :: Result < FileHash > { let mut file = open ( path , offset , len , cache_policy ) ? ; let hash = stream_hash ( & mut file , len , buf_len , progress ) ? . 1 ; evict_page_cache_if_low_mem ( & mut file , len ) ; Ok ( hash ) }
Computes hash of initial `len` bytes of a file.
Computes hash of initial ` len ` bytes of a file .
path
&Path
offset
FilePos
len
FileLen
buf_len
usize
cache_policy
Caching
progress
impl Fn(usize)
path
&Path
offset
FilePos
len
FileLen
buf_len
usize
cache_policy
Caching
progress
impl Fn(usize)