Skip to contents

Not base64enc: that emits the standard +/ alphabet with = padding, and the three-character fixup afterwards is exactly the kind of step that silently survives a round trip in one language and not the other. The alphabet is checked on the way in, so +, / and = are a named rejection rather than a stray byte.

Usage

b64url_encode(raw)

b64url_decode(s)

Arguments

raw

a raw vector

s

a base64url string

Value

the encoded string / the decoded raw vector

Examples

b64url_encode(as.raw(c(0x10, 0x03)))
#> [1] "EAM"
b64url_decode("EAM")
#> [1] 10 03