Question: I am currently writing a parser to interpret GWT RPC's responses.

However, I am having a difficult time trying to figure out the encoding GWT uses to encode java.lang.Long values (i.e. not a primitive long -- which would be Base64)

Here is an example RPC payload used to retrieve a group object by it's ID (via .retrieve(java.lang.Long id)):

```
7|0|5|http://10.0.1.35:8005/platform/gwt/com.application.gwt.Contacts/|57C71F0104C208A16262D2898A6133DD|com.application.gwt.client.rpc.GroupService|retrieve|java.lang.Long/4227064769|1|2|3|4|1|5|5|PFu|

```

I have managed to figure out that the value "PFu" (at the end) is the group's encoded ID used in the retrieve method.

The actual group's ID is "61806".

So my question is, how does "61806" become "PFu"? What encoding is used here? It does not appear to be Base 64.

Other cases include:

iW = 2198
D4O = 15886

Answer: 
In fact, based on your examples it is perfectly valid Base64.

However, it seems the last two digits (worth 62, 63) use '$' and '\_' respectively, as opposed to the more common '+' and '/'.

The underscore makes it URL safe and is used in some implementations, but the dollar sign must be their own invention.

If you run your examples through a converter, you may get the wrong result if the values are being ascii encoded (which they probably are).
You can use the GWT com.google.gwt.user.server.Base64Utils class to get the encoded / decoded values.

e.g.

```
String val  = Base64Utils.toBase64(727854);
long l  = Base64Utils.longFromBase64("WIe7dms");

```