Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coercion to character fails on file hashes? #81

Open
cboettig opened this issue Aug 16, 2020 · 0 comments
Open

coercion to character fails on file hashes? #81

cboettig opened this issue Aug 16, 2020 · 0 comments

Comments

@cboettig
Copy link

If I generate a hash like for a file and coerce it to a character, it still doesn't have class character:

hash <- openssl::md5(file(system.file("CITATION")))
x <- as.character(hash)
class(x)

# [1] "hash" "md5" 

This doesn't effect hashes generated from strings. This can obviously create issues downstream, e.g. if I try and serialize the has to JSON:

jsonlite::toJSON(list(hash = x))
Error: No method asJSON S3 class: md5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant