I need to pass data in encrypted format with URL like this,
http://localhost:8080/app/{encrypted_data}
So, is there any encoder which will not include forward slash(/) in encoding?
Please Note: I don't want to replace '/' by another character, manually, from the encoded data.
..............................................................................................................
Edited: comment from Oleg Estekhin of using Base64 URL safe Encoding is also working fine, I'm just adding an example over here.
EXAMPLE: Encode:
String str = "subjects?_d=1";
byte[] bytesEncoded = Base64.encodeBase64URLSafe((str.getBytes()));
Decode:
Base64 decoder = new Base64(true);
byte[] decodedBytes = decoder.decode(new String(bytesEncoded));
System.out.println(new String(decodedBytes));
Output:
c3ViamVjdHM_X2Q9MQ
subjects?_d=1
http://en.wikipedia.org/wiki/Base32
example:
Encode string to base32 string in Java
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With