Last active
April 21, 2023 12:29
-
-
Save b8x/673e7f31b433a1baaaca9c954982ae3f to your computer and use it in GitHub Desktop.
Base 64 Encoder Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Base64; | |
public class Base64Encoder { | |
public static void main(String[] args) { | |
String message = "Hello, world!"; | |
// Encode the message | |
String encodedMessage = Base64.getEncoder().encodeToString(message.getBytes()); | |
// Print the encoded message | |
System.out.println(encodedMessage); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment