base64: Encode/decode base64

base64R Documentation

Encode/decode base64

Description

Simple in-memory base64 encoder and decoder. Used internally for converting raw vectors to text. Interchangeable with encoder from base64enc or openssl package.

Usage

base64_dec(input)

base64_enc(input)

base64url_enc(input)

base64url_dec(input)

Arguments

input

string or raw vector to be encoded/decoded

Details

The base64url_enc and base64url_dec functions use a variation of base64 that substitute characters ⁠+/⁠ for ⁠-_⁠ respectively, such that the output does not require URL-encoding. See also section 5 of rfc4648.

Examples

str <- base64_enc(serialize(iris, NULL))
out <- unserialize(base64_dec(str))
stopifnot(identical(out, iris))

jsonlite documentation built on Sept. 20, 2024, 9:07 a.m.