user1605665
user1605665

Reputation: 4151

How do i make the result of base64enc::base64decode human readable

I have some text that is base 64 encoded and want to decode it in R. The package im using is base64decode of the base64enc package. The problem I have is that its not human readable. How do i make it work

e.g. This is what i get from a text string that was endcoded from "exampleEncodedText"

 base64enc::base64decode("ZXhhbXBsZUVuY29kZWRUZXh0")
 [1] 65 78 61 6d 70 6c 65 45 6e 63 6f 64 65 64 54 65 78 74

For reference i encoded it on https://www.base64decode.org/

Upvotes: 2

Views: 1628

Answers (1)

Julius Vainora
Julius Vainora

Reputation: 48221

?base64decode says that this function decodes a base64-encoded string into binary data. So, using rawToChar gives a human readable character:

rawToChar(base64decode("ZXhhbXBsZUVuY29kZWRUZXh0"))
[1] "exampleEncodedText"

Upvotes: 2

Related Questions