Skip to contents

Compute the SHA-256 digest of a file

Usage

cer_sha256(file)

Arguments

file

Path to a local file.

Value

A length-1 character string (hex digest), or NA if the file does not exist. Uses digest::digest() when the digest package is available (recommended for research work), falling back to tools::md5sum() otherwise.

Examples

f <- tempfile()
writeLines("hello", f)
cer_sha256(f)