Skip to contents

Wraps tools::md5sum() style behaviour for SHA-256 via the digest package when available, or falls back to a pure-R implementation via tools::md5sum() + file length as a weaker check. For integrity work PBO/Grattan-grade, install the digest package (Suggests).

Usage

ato_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.

Examples

f <- tempfile()
writeLines("hello", f)
ato_sha256(f)
#> [1] "5891b5b522d5df086d0ff0b110fbd9d21bb4fc7163af34d08286a2e846f6be03"