base32_encode: Encode to base32 or Decode from base32

Description Usage Arguments Value References Examples

Description

Simple RFC4648 base32 encoder/decoder. Pads with “=”.

Usage

1
2
3
base32_encode(x, use.padding = FALSE)

base32_decode(x, use.padding = FALSE)

Arguments

x

[character(1)]
Character vector to encode or decode.

use.padding

[logical(1)]
If TRUE, base32_encode returns a string whose length is a multiple of 8, padded with trailing “=” if required. base32_decode expects such a string unless this is set to FALSE (default). The internal algorithm currently works with padding, thus it is faster to set this to TRUE.

Value

[character] of the same length as input x.

References

Implementation based on base32 encoder/decoder in the GNU lib: https://www.gnu.org/software/gnulib/.

Examples

1
2
3
4
5
x = "plain text"
encoded = base32_encode(x)
decoded = base32_decode(encoded)
print(encoded)
print(decoded)

Example output

[1] "OBWGC2LOEB2GK6DU"
[1] "plain text"

base64url documentation built on May 2, 2019, 9:18 a.m.