R/digestFile.R

Defines functions digestFile

Documented in digestFile

#' calculate a digest of a file
#'
#' @param f character scalar; path to file
#' @param algo; algorithm for digest; default: "sha1"
#'
#' @return character scalar lower-case hex sha1 digest
#'
#' @export
#'
#' @author John Brzustowski \email{jbrzusto@@REMOVE_THIS_PART_fastmail.fm}

digestFile = function(f, algo="sha1") {
    digest::digest(readBin(f, raw(), n=file.size(f)), algo=algo, serialize=FALSE)
}
jbrzusto/motusServer documentation built on May 19, 2019, 8:19 a.m.