R/base64.R

Defines functions base64_encode base64_decode

Documented in base64_decode base64_encode

#' 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 = ""))
  }
  rethrow_call(c_processx_base64_decode, x)
}

#' @export
#' @rdname base64_decode

base64_encode <- function(x) {
  rawToChar(rethrow_call(c_processx_base64_encode, x))
}
r-pkgs/processx documentation built on Nov. 13, 2019, 11:17 p.m.