utils: Utility Functions

b64_chunkR Documentation

Utility Functions

Description

Functions to perform common tasks when working with base64 encoded strings.

Usage

b64_chunk(encoded, width)

b64_wrap(chunks, newline)

Arguments

encoded

a character vector of base64 encoded strings.

width

a numeric scalar defining the width of the chunks. Must be divisible by 4.

chunks

a character vector of base64 encoded strings.

newline

a character scalar defining the newline character.

Details

b64_chunk() splits a character vector of base64 encoded strings into chunks of a specified width.

b64_wrap() wraps a character vector of base64 encoded strings with a newline character.

Value

  • b64_chunk() returns a list of character vectors.

  • b64_wrap() returns a scalar character vector.

Examples

encoded <- encode("Hello, world!")
chunked <- b64_chunk(encoded, 4)
chunked

b64_wrap(chunked, "\n")

b64 documentation built on June 8, 2025, 10:32 a.m.