base64enc {nanonext} | R Documentation |
Base64 Encode / Decode
Description
Encodes / decodes a character string, raw vector or other object to base64 encoding.
Usage
base64enc(x, convert = TRUE)
base64dec(x, convert = TRUE)
Arguments
x |
an object. |
convert |
For base64enc: [default TRUE] logical TRUE to encode
to a character string or FALSE to a raw vector. |
Details
For encoding: a character string or raw vector (with no attributes) is encoded as is, whilst all other objects are first serialized (using R serialisation version 3, big-endian representation).
For decoding: the value of ‘convert’ should be set to TRUE, FALSE or NA to be the analogue of the above 3 cases in order to return the original object.
Value
For base64enc: A character string or raw vector depending on the value of ‘convert’.
For base64dec: A character string, raw vector, or other object depending on the value of ‘convert’.
Examples
base64enc("hello world!")
base64dec(base64enc("hello world!"))
base64enc(as.raw(c(1L, 2L, 4L)), convert = FALSE)
base64dec(base64enc(as.raw(c(1L, 2L, 4L))), convert = FALSE)
base64enc(data.frame())
base64dec(base64enc(data.frame()), convert = NA)