File: base64_encode.Rd

package info (click to toggle)
r-cran-xfun 0.37%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 792 kB
  • sloc: ansic: 242; sh: 22; makefile: 2
file content (35 lines) | stat: -rw-r--r-- 1,051 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/base64.R
\name{base64_encode}
\alias{base64_encode}
\alias{base64_decode}
\title{Encode/decode data into/from base64 encoding.}
\usage{
base64_encode(x)

base64_decode(x, from = NA)
}
\arguments{
\item{x}{For \code{base64_encode()}, a raw vector. If not raw, it is assumed
to be a file or a connection to be read via \code{readBin()}. For
\code{base64_decode()}, a string.}

\item{from}{If provided (and \code{x} is not provided), a connection or file
to be read via \code{readChar()}, and the result will be passed to the
argument \code{x}.}
}
\value{
\code{base64_encode()} returns a character string.
  \code{base64_decode()} returns a raw vector.
}
\description{
The function \code{base64_encode()} encodes a file or a raw vector into the
base64 encoding. The function \code{base64_decode()} decodes data from the
base64 encoding.
}
\examples{
xfun::base64_encode(as.raw(1:10))
logo = xfun:::R_logo()
xfun::base64_encode(logo)
xfun::base64_decode("AQIDBAUGBwgJCg==")
}