| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/cache.R |
| 3 |
\name{md5} |
| 4 |
\alias{md5} |
| 5 |
\title{Calculate the MD5 checksums of R objects} |
| 6 |
\usage{ |
| 7 |
md5(...) |
| 8 |
} |
| 9 |
\arguments{ |
| 10 |
\item{...}{Any number of R objects.} |
| 11 |
} |
| 12 |
\value{ |
| 13 |
A character vector of the checksums of objects passed to \code{md5()}. If |
| 14 |
the arguments are named, the results will also be named. |
| 15 |
} |
| 16 |
\description{ |
| 17 |
\link[=serialize]{Serialize} an object and calculate the checksum via |
| 18 |
\code{\link[tools:md5sum]{tools::md5sum()}}. If \code{tools::md5sum()} does not have the argument \code{bytes}, |
| 19 |
the object will be first serialized to a temporary file, which will be |
| 20 |
deleted after the checksum is calculated, otherwise the raw bytes of the |
| 21 |
object will be passed to the \code{bytes} argument directly (which will be |
| 22 |
faster than writing to a temporary file). |
| 23 |
} |
| 24 |
\examples{ |
| 25 |
x1 = 1 |
| 26 |
x2 = 1:10 |
| 27 |
x3 = seq(1, 10) |
| 28 |
x4 = iris |
| 29 |
x5 = paste |
| 30 |
(m = xfun::md5(x1, x2, x3, x4, x5)) |
| 31 |
stopifnot(m[2] == m[3]) # x2 and x3 should be identical |
| 32 |
|
| 33 |
xfun::md5(x1 = x1, x2 = x2) # named arguments |
| 34 |
} |