EVOLUTION-MANAGER
Edit File: base64.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Encode/decode data into/from base64 encoding</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for base64 {base64enc}"><tr><td>base64 {base64enc}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2> Encode/decode data into/from base64 encoding </h2> <h3>Description</h3> <p><code>base64encode</code> encodes a data into base64 encoding. The source can be a file, binary connection or a raw vector. </p> <p><code>base64decode</code> decodes a base64-encoded string into binary data. The source can be a string or a connection, the output is either a raw vector (<code>output=NULL</code>) or a binary connection. </p> <h3>Usage</h3> <pre> base64encode(what, linewidth, newline) base64decode(what, output = NULL, file) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>what</code></td> <td> <p>data to be encoded/decoded. For <code>base64encode</code> it can be a raw vector, text connection or file name. For <code>base64decode</code> it can be a string or a binary connection.</p> </td></tr> <tr valign="top"><td><code>linewidth</code></td> <td> <p>if set, the output is split into lines with at most <code>linewidth</code> characters per line. Zero or <code>NA</code> denotes no limit and values 1 .. 3 are silently treated as 4 since that is the shortest valid line.</p> </td></tr> <tr valign="top"><td><code>newline</code></td> <td> <p>only applicable if <code>linewidth</code> is set; if set (string), the result will be a single string with all lines joined using the <code>newline</code> string</p> </td></tr> <tr valign="top"><td><code>output</code></td> <td> <p>if <code>NULL</code> then the output will be a raw vector with the decoded data, otherwise it must be either a filename (string) or a binary connection.</p> </td></tr> <tr valign="top"><td><code>file</code></td> <td> <p>file name (string) for data to use as input instead of <code>what</code>. It is essentially just a shorthand for <code>base64decode(file(name))</code>. Only one of <code>what</code> and <code>file</code> can be specified.</p> </td></tr> </table> <h3>Value</h3> <p><code>base64encode</code>: A character vector. If <code>linewith > 0</code> and <code>newline</code> is not set then it will consist of as many elements as there are lines. Otherwise it is a single string. </p> <p><code>base64decode</code>: If <code>output = NULL</code> then a raw vector with the decoded content, otherwise the number of bytes written into the connection. </p> <h3>Author(s)</h3> <p>Simon Urbanek </p> <h3>Examples</h3> <pre> 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)) </pre> <hr /><div style="text-align: center;">[Package <em>base64enc</em> version 0.1-3 <a href="00Index.html">Index</a>]</div> </body></html>