Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.apache.commons.codec.binary.Base64;
- public class Base64Demo {
- public static void main(String[] args) {
- String userName = "eoeAndroid";
- String password = "this is password";
- String authCombination = userName + ":" + password;
- String authBase64 = new String(Base64.encodeBase64(authCombination.getBytes()));
- System.out.println("authCombination = "+authCombination);
- System.out.println("authBase64 = "+authBase64);
- String authRecovery = new String(Base64.decodeBase64(authBase64.getBytes()));
- System.out.println("authRecovery = "+authRecovery);
- }
- }
Add Comment
Please, Sign In to add comment