Type: | Package |
Title: | Base64 Encoder and Decoder |
Version: | 2.0.2 |
Description: | Compatibility wrapper to replace the orphaned package. New applications should use base64 encoders from 'jsonlite' or 'openssl' or 'base64enc'. |
License: | MIT + file LICENSE |
Imports: | openssl |
RoxygenNote: | 7.2.1 |
Encoding: | UTF-8 |
NeedsCompilation: | no |
Packaged: | 2024-10-03 14:12:12 UTC; jeroen |
Author: | Jeroen Ooms [aut, cre] |
Maintainer: | Jeroen Ooms <jeroenooms@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2024-10-04 13:00:05 UTC |
Encode and Decode base64
Description
Wrapper for openssl::base64_encode.
Usage
encode(input, output = tempfile(), linebreaks = TRUE)
decode(input, output = tempfile())
Arguments
input |
input file |
output |
output file |
linebreaks |
insert linebreaks to make output human readable See openssl::base64_encode |
Examples
# encode a file
myfile <- R.home("COPYING")
tmp <- tempfile()
base64::encode(myfile, tmp)
# decode it back
orig <- tempfile()
base64::decode(tmp, orig)
readLines(orig)
Encode a png file as a img data uri
Description
This creates html code to embed a png file into an html document.
Usage
img(file, Rd = FALSE, alt = "image")
Arguments
file |
png file to translate into a data uri |
Rd |
if |
alt |
alternate text |
Examples
pngfile <- tempfile()
png(pngfile, width = 600, height = 400)
plot(1:100, rnorm(100), pch = 21, bg = "red", cex = 2 )
dev.off()
img(pngfile, Rd = TRUE)