Criar variável com Base64

Boa tarde,
estou tentando criar uma variável com um base64, para usar o base64decode, mas o R não reconhece. Acredito que não funcione pelo numero de caracteres. Existe alguma função especifica para isso ?

1 Curtida

Algo assim?

library(magrittr)
x <- c(1,2,3,4,5) %>% as.raw() %>% base64enc::base64encode()
x %>% base64enc::base64decode() %>% as.numeric()
#> [1] 1 2 3 4 5

Created on 2020-02-28 by the reprex package (v0.3.0)

Não, estou tentando pegar o código e decodar, mas não vai. Se pego uma imagem e uso o base64encode() e depois o base64decode, funciona, mas quando pego o código copiando o endereço da imagem direto do site, não funciona.

Não sei se entendi direito…
Será que é algo assim que vc quer?

library(magrittr)

img <- "https://discourse.curso-r.com/uploads/default/original/1X/0f8634d385cde194b72d39097f4ea662017e0933.png" %>%
  readr::read_file_raw() %>%
  base64enc::base64encode()

img
#> [1] "iVBORw0KGgoAAAANSUhEUgAABSAAAAHjCAMAAAAE+EEqAAAAxlBMVEUAAAD///8Ls8IOoUcjHyDtGjYLs8IOoUcjHyDtGjYLs8IOoUcjHyDtGjYLs8IOoUcjHyDtGjYLs8IOoUcjHyDtGjYLs8IOoUcjHyDtGjYLs8IOoUcjHyDtGjYLs8IOoUcjHyDtGjYLs8IOoUcjHyDtGjYLs8IOoUcjHyDtGjYLs8IOoUcjHyDtGjYLs8IOoUcjHyDtGjYLs8IOoUcjHyDtGjYLs8IOoUcjHyDtGjYLs8IOoUcjHyDtGjYLs8IOoUcjHyDtGjZ1vYu9AAAAPnRSTlMAABAQEBAgICAgMDAwMEBAQEBQUFBQYGBgYHBwcHCAgICAj4+Pj5+fn5+vr6+vv7+/v8/Pz8/f39/f7+/v79A115EAACNZSURBVHja7d1tQ9O8AoDhHCg4ZEDRKUWnFN2jRQdWHTqhG9v//1OHNxVZu7V5aZP0vj+dL4dnbum1tEk78T8iIspN8BYQEQEkERFAEhEBJBERQBIRASQREUASEQEkERFAEhEBJBERQBIRASQREQEkERFAEhEBJBERQBIRASQREUASEQEkERFAEhEBJBERQBIRASQREQEk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% 
  as.raster() %>% 
  plot()

Created on 2020-02-28 by the reprex package (v0.3.0)

Assim, com esse base64

Andersson, você tem a origem dessa imagem? Talvez com a original seja mais fácil descobrir como ler. Acredito que a solução seja retirar o data:image/png;base64 do início do texto, mas pode ser outra coisa.

1 Curtida

Testei com um base64 de outra imagem, e consegui. Esse tinha menos caracteres, acho que seja o numero de caracteres que esteja impedindo de criar a variável.

1 Curtida