Hi there! I was wondering if you would be able to make functions in this package accept raw vectors as well as characters.
This is because sometimes raw vectors can not be converted to characters because they contain NUL (00), causing rawToChar to error out.
My application is checking web pages against archives in the Wayback machine, which fingerprints web pages as base32-encoded SHA1s of webpage contents. It's the SHA1 that sometimes has 00 values in it.
So this will fail for some URLs:
content <- readBin(url("https://example.com", open = "rb"), "raw", n=10000)
content |>
digest::digest(algo = "sha1", serialize = FALSE, raw = TRUE) |>
rawToChar() |>
base64url::base32_encode()
(Returning the SHA1 as a character does not help, as digest is ju
This is the only R base32 encoder I can find. base64s are a dime a dozen :) Thanks for it!
Hi there! I was wondering if you would be able to make functions in this package accept raw vectors as well as characters.
This is because sometimes raw vectors can not be converted to characters because they contain NUL (
00), causing rawToChar to error out.My application is checking web pages against archives in the Wayback machine, which fingerprints web pages as base32-encoded SHA1s of webpage contents. It's the SHA1 that sometimes has
00values in it.So this will fail for some URLs:
(Returning the SHA1 as a character does not help, as
digestis juThis is the only R base32 encoder I can find. base64s are a dime a dozen :) Thanks for it!