Functions to perform common tasks when working with base64 encoded strings.
b64_chunk(encoded, width)
b64_wrap(chunks, newline)
b64_chunk()
returns a list of character vectors.
b64_wrap()
returns a scalar character vector.
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.
encoded <- encode("Hello, world!")
chunked <- b64_chunk(encoded, 4)
chunked
#> [[1]]
#> [1] "SGVs" "bG8s" "IHdv" "cmxk" "IQ=="
#>
b64_wrap(chunked, "\n")
#> [1] "SGVs\nbG8s\nIHdv\ncmxk\nIQ=="