Computes a hash of a file's contents by reading the file as raw bytes and
hashing them via secretbase::siphash13(). This is faster than reading the
file into R first because secretbase can stream the file directly.
Use Cases
Detecting if an artifact file has been modified on disk
Verifying file integrity across copies
Checking if a file needs to be re-saved
Note
This hashes the file's raw bytes, not its R representation. If you save an
R object with saveRDS(), the file hash will change even if the object
content is the same (due to timestamps, compression variation, etc.). Use
st_hash_obj() for content-based hashing of R objects.