Description Usage Arguments Value Author(s) Examples
base64encode
encodes a data into base64 encoding. The source
can be a file, binary connection or a raw vector.
base64decode
decodes a base64-encoded string into binary
data. The source can be a string or a connection, the output is
either a raw vector (output=NULL
) or a binary connection.
1 2 | base64encode(what, linewidth, newline)
base64decode(what, output = NULL, file)
|
what |
data to be encoded/decoded. For |
linewidth |
if set, the output is split into lines with at most
|
newline |
only applicable if |
output |
if |
file |
file name (string) for data to use as input instead of
|
base64encode
: A character vector. If linewith > 0
and
newline
is not set then it will consist of as many elements
as there are lines. Otherwise it is a single string.
base64decode
: If output = NULL
then a raw vector with
the decoded content, otherwise the number of bytes written into the
connection.
Simon Urbanek
1 2 3 4 5 6 | base64encode(1:100)
base64encode(1:100, 70)
base64encode(1:100, 70, "\n")
x <- charToRaw("the decoded content, otherwise the number of bytes")
y <- base64decode(base64encode(x))
stopifnot(identical(x, y))
|
[1] "AQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaW1xdXl9gYWJjZA=="
[1] "AQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIz"
[2] "NDU2Nzg5Ojs8PT4/QEFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaW1xdXl9gYWJjZA=="
[1] "AQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIz\nNDU2Nzg5Ojs8PT4/QEFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaW1xdXl9gYWJjZA=="
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.