Calculate the MD5 hash of each element of a character vector.

hash_md5(x)

Arguments

x

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.

Value

Character vector of hexadecimal MD5 hashes.

See also

tools::md5sum() for a base R MD5 function that works on files.

Other hash functions: hash_animal(), hash_emoji()

Examples

hash_md5(c("foo", NA, "bar", ""))
#> [1] "acbd18db4cc2f85cedef654fccc4a4d8" NA                                
#> [3] "37b51d194a7513e45b56f6524f2d51f2" "d41d8cd98f00b204e9800998ecf8427e"