Closed dpmccabe closed 5 years ago
> str(as.character(openssl::md5(""))) Classes 'hash', 'md5' chr "d41d8cd98f00b204e9800998ecf8427e" > class(as.character(openssl::md5(""))) [1] "hash" "md5"
This creates problems when other packages examine the class of an object expected to be a character:
> jsonlite::toJSON(as.character(openssl::md5(""))) Error: No method asJSON S3 class: md5
You can use unclass instead of as.character for this specific use case:
unclass
as.character
> jsonlite::toJSON(unclass(openssl::md5(""))) ["d41d8cd98f00b204e9800998ecf8427e"]
This creates problems when other packages examine the class of an object expected to be a character: