Calculate the SHA-1 hash of each element of a character vector.
hash_sha1(x)
hash_raw_sha1(x)
hash_obj_sha1(x, serialize_version = 2)
hash_file_sha1(paths)Character vector. If not a character vector, then
as.character() is used to try to coerce it into one. NA entries
will have an NA hash.
Workspace format version to use, see
base::serialize().
Character vector of file names.
hash_sha1() returns a character vector of hexadecimal
SHA-1 hashes.
hash_raw_sha1() returns a character scalar.
hash_obj_sha1() returns a character scalar.
hash_file_sha1() returns a character vector of SHA-1
hashes.
hash_raw_sha1() calculates the SHA-1 hash of the bytes
of a raw vector.
hash_obj_sha1() calculates the SHA-1 hash of an R
object. The object is serialized into a binary vector first.
hash_file_sha1() calculates the SHA-1 hash of one or
more files.
Other hash functions:
hash_animal(),
hash_emoji(),
hash_md5(),
hash_sha256(),
hash_xxhash()
hash_sha1(c("foo", NA, "bar", ""))
#> [1] "0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33"
#> [2] NA
#> [3] "62cdb7020ff920e5aa642c3d4066950dd1f01f4d"
#> [4] "da39a3ee5e6b4b0d3255bfef95601890afd80709"