Forum Stats

  • 3,722,431 Users
  • 2,244,307 Discussions


Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Setting a Base64 alphabet

I can do:

String encoded = Base64.getEncoder().withoutPadding().encodeToString(someByteArray);

so why can't I also do something like:

static final String PWD_B64ALPHABET = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";

String encoded = Base64.getEncoder().withAlphabet(PWD_B64ALPHABET).encodeToString(someByteArray);

(and similarly with Base64.Decoder)

Given just how many variations of "base64" encoding there are out there, this would seem super useful.

Sign In or Register to comment.