File: base64.R

package info (click to toggle)
r-cran-processx 3.8.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,068 kB
  • sloc: ansic: 6,485; sh: 13; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 442 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

#' Base64 Encoding and Decoding
#'
#' @param x Raw vector to encode / decode.
#' @return Raw vector, result of the encoding / decoding.
#'
#' @export

base64_decode <- function(x) {
  if (is.character(x)) {
    x <- charToRaw(paste(gsub("\\s+", "", x), collapse = ""))
  }
  chain_call(c_processx_base64_decode, x)
}

#' @export
#' @rdname base64_decode

base64_encode <- function(x) {
  rawToChar(chain_call(c_processx_base64_encode, x))
}