| Title: | Fast and Vectorized Base32 Encoding |
| Version: | 0.1.0 |
| Description: | Fast, dependency free, and vectorized base32 encoding and decoding. 'b32' supports the Crockford, Z, RFC 4648 lower, hex, and lower hex alphabets. |
| License: | MIT + file LICENSE |
| URL: | https://github.com/extendr/b32, http://extendr.rs/b32/ |
| Depends: | R (≥ 4.2) |
| Suggests: | blob, testthat (≥ 3.0.0) |
| Config/rextendr/version: | 0.4.2.9000 |
| Config/testthat/edition: | 3 |
| Encoding: | UTF-8 |
| Language: | en |
| RoxygenNote: | 7.3.3 |
| SystemRequirements: | Cargo (Rust's package manager), rustc >= 1.65.0, xz |
| NeedsCompilation: | yes |
| Packaged: | 2026-01-19 18:51:47 UTC; josiahparry |
| Author: | Josiah Parry |
| Maintainer: | Josiah Parry <josiah.parry@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-01-23 14:40:12 UTC |
Base32 Encode and Decode
Description
Base32 Encode and Decode
Usage
encode(x, alphabet = "crockford", padded = TRUE)
decode(x, alphabet = "crockford", padded = TRUE)
decode_as_string(x, alphabet = "crockford", padded = TRUE)
Arguments
x |
for |
alphabet |
default '"crockford". The base32 encoding alphabet to use. Must be one of "crockford", "rfc4648", "rfc4648lower", "rfc4648hex", "rfc4648hexlower", or "z". |
padded |
default TRUE. Appends |
Details
decode() returns a blob object which is a list of raw vectors.
If an error is encountered in decode() the result will be an NA.
Value
decode() returns a blob object. encode() returns a character vector. decode_as_string() returns a character vector.
Examples
encode("hello")
encode("hello", padded = FALSE)
encode("hello", alphabet = "rfc4648")
# Decode base32 string
decode("NBSWY3DPEBLW64TMMQ======")
decode_as_string("NBSWY3DPEBLW64TMMQ======")
decode("NBSWY3DPEBLW64TMMQ", padded = FALSE)