tags:

views:

607

answers:

3

I need to encode a short String as base 64 in GWT and decode the base 64 string on the server. Anyone have utility class or library for this?

+1  A: 

Apache commons-codec has a Base64 class. It should work with GWT.

// client-side code
String base64String = Base64.encodeBase64(yourString.getBytes());

// server-side code
String originalString = new String(Base64.decodeBase64(base64String.getBytes()));
Bozho
A: 

I've used the apache commons one with good results.

Steen
+2  A: 

I use this one java file in GWT projects. Very simple.

jpartogi