This week's giveaway is in the Threads forum.
We're giving away four copies of Java Concurrency Live Lessons and have Doug Schmidt on-line!
See this thread for details.
Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Help:: how can I do the base64 encoding?  RSS feed

 
Zoe Peng
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
How can I do the base64 encoding?
I have username and password from usr input form.
I want to encode these data with base64.
How to approach this? I found out there is a BASE64Encoder in javax.commerce.util package. But, I really don't know how this works. Thakns.

//get usrname and password
String username = request.getParameter("username");
String password = request.getParameter("password");
String userInfo = username + password;

out.println(userInfo);
//encoder username and password
BASE64Encoder encoder = new BASE64Encoder();
 
James Swan
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow, I had a look at the API for that encoder and it is very confusing.
You could try another implementation such as this one.
James.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!