R has a built-in MD5 checksum calculator tools::md5sum(), but it only operates on files. It takes a vector of pathnames (not connections) as input and returns a character string of the same length containing MD5 checksums, e.g.
Calculating MD5 checksums is such a common task that it would warrant a core R functions for calculating the checksum for an R object x, e.g. tools::md5(x).
There is an internal src/library/tools/src/md5.c file that implements the MD5 checksum. It even has an internal md5_buffer() function that seems to do exactly this.
See also
digest package: Provides well-tested function digest::digest(x, algo="md5") for calculating the MD5 checksum for R object x.
Background
R has a built-in MD5 checksum calculator
tools::md5sum()
, but it only operates on files. It takes a vector of pathnames (not connections) as input and returns a character string of the same length containing MD5 checksums, e.g.Wish / Suggestion
Calculating MD5 checksums is such a common task that it would warrant a core R functions for calculating the checksum for an R object
x
, e.g.tools::md5(x)
.There is an internal
src/library/tools/src/md5.c
file that implements the MD5 checksum. It even has an internalmd5_buffer()
function that seems to do exactly this.See also
digest::digest(x, algo="md5")
for calculating the MD5 checksum for R objectx
.