Skip to content

Instantly share code, notes, and snippets.

@alexandramartinez
Created July 1, 2020 00:35
Show Gist options
  • Save alexandramartinez/3637f05c295e3868fcec56866261a59c to your computer and use it in GitHub Desktop.
Save alexandramartinez/3637f05c295e3868fcec56866261a59c to your computer and use it in GitHub Desktop.
import java.util.Base64;
public class Base64UrlEncoding {
public static void main(String []args) {
byte[] bytes = "prostdev?blog".getBytes();
String encodedString = new String(Base64.getUrlEncoder().encode(bytes));
System.out.println(encodedString);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment