One-way hash function in R [duplicate]

2019-06-03 12:42发布

问题:

This question already has an answer here:

  • how to create md5 hash of a column in R? 3 answers

Is there a repeatable one-way hash function in R? I'd use hashlib in Python:

hashlib.sha224("This is my input").hexdigest()

回答1:

If you have the digest pacakge installed, you can do

digest::digest("This is my input")
# [1] "2e936bb276abca8a9e46bd32c7bdc01e"

(by default the result is returned as ASCII hex values). See the ?digest help page for a list of supported hashing algorithms.



回答2:

You might want to have a look at the digest package.



标签: r hash