mdsums: SHA256 checksums of bundled rmoriedata files

View source: R/provenance.R

mdsumsR Documentation

SHA256 checksums of bundled rmoriedata files

Description

Computes the SHA256 digest of every file rmoriedata bundles in inst/extdata, each file read once and only when it is a regular file (NA for any other path, and for a file larger than 1 GiB), and compares each with the digest the signed manifest records for it (in_manifest). For the full check, signature included, use mdverify(); this function is the per-file record an analysis can pin and compare later.

Usage

mdsums()

Value

A data frame with one row per bundled file, in the byte order of path (the same in every locale), and columns path (relative to the extdata root, forward slashes, unique), file (the bare basename), bytes, sha256, and in_manifest (TRUE when the signed manifest lists the file with this digest; NA for the manifest's own files). Use path to locate a file; several basenames recur in more than one directory.

Examples

# One row per bundled file: name, size in bytes, SHA256 digest.
ck <- mdsums()
str(ck)
head(ck)

# Total bundled payload and the largest few files.
sum(ck$bytes)
head(ck[order(-ck$bytes), c("file", "bytes")], 3)

# Provenance workflow: pin the digest of a file you depend on, then
# assert it hasn't changed under you in a later session / reinstall.
if (nrow(ck)) {
  pinned <- ck$sha256[1]
  again <- mdsums()
  stopifnot(again$sha256[again$path == ck$path[1]] == pinned)
}

rmoriedata documentation built on Nov. 18, 2026, 5:06 p.m.