Skip to contents

Read File with Required Hash Match

Usage

read_hashed_file(
  file_path,
  hash,
  ...,
  algo = "blake3",
  reader = NULL,
  force = FALSE
)

Arguments

file_path

path to file with data you want to read

hash

hash you expect the file to have

...

additional arguments for digest or read_csv, parquet, sas, or reader

algo

hashing algorithm to use, default is "blake3"

reader

optional function used to read the file, called as reader(file_path, ...) once the hash check passes. Required for file extensions this function doesn't know how to read. For a known extension (csv, parquet, sas7bdat, xpt, pzfx, xlsx/xls/xlsm), reader is ignored unless force = TRUE.

force

if TRUE, use reader even for a known extension instead of the built-in reader. Must be FALSE (the default) when reader is not supplied.

Value

data object of contents of file_path

Examples