| Title: | Fast and Vectorized Base32 Encoding |
|---|---|
| Description: | Fast, dependency free, and vectorized base32 encoding and decoding. 'b32' supports the Crockford, Z, RFC 4648 lower, hex, and lower hex alphabets. |
| Authors: | Josiah Parry [aut, cre] (ORCID: <https://orcid.org/0000-0001-9910-865X>) |
| Maintainer: | Josiah Parry <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-05-24 09:13:06 UTC |
| Source: | https://github.com/extendr/b32 |
Base32 Encode and Decode
encode(x, alphabet = "crockford", padded = TRUE) decode(x, alphabet = "crockford", padded = TRUE) decode_as_string(x, alphabet = "crockford", padded = TRUE)encode(x, alphabet = "crockford", padded = TRUE) decode(x, alphabet = "crockford", padded = TRUE) decode_as_string(x, alphabet = "crockford", padded = TRUE)
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 |
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.
decode() returns a blob object. encode() returns a character vector. decode_as_string() returns a character vector.
encode("hello") encode("hello", padded = FALSE) encode("hello", alphabet = "rfc4648") # Decode base32 string decode("NBSWY3DPEBLW64TMMQ======") decode_as_string("NBSWY3DPEBLW64TMMQ======") decode("NBSWY3DPEBLW64TMMQ", padded = FALSE)encode("hello") encode("hello", padded = FALSE) encode("hello", alphabet = "rfc4648") # Decode base32 string decode("NBSWY3DPEBLW64TMMQ======") decode_as_string("NBSWY3DPEBLW64TMMQ======") decode("NBSWY3DPEBLW64TMMQ", padded = FALSE)