Encode and decode using base64
Arguments
- what
a character, raw, or blob vector
- eng
a base64 engine. See
engine()
for details.- path
a path to a base64 encoded file.
Value
Both encode()
and decode()
are vectorized. They will return a character
and blob vector the same length as what
, respectively.
Examples
# encode hello world
encoded <- encode("Hello world")
encoded
#> [1] "SGVsbG8gd29ybGQ="
# decode to a blob
decoded <- decode(encoded)
decoded
#> <blob[1]>
#> [1] blob[11 B]
# convert back to a character
rawToChar(decoded[[1]])
#> [1] "Hello world"