Skip to content

Tag: base64

Base 64 decode to String not as expected

I have a String that I want to decode to a binary object (BigInteger or its String) Say for instance I got the String An now I want to decode it using the Base64.getDecoder() method, such as: According to that, the value of result is 101101001100010011000000110001001100000011000000110001001100010011000000110001001100010011000100110000 which does not match with the result that I obtain using any online decoder:

Convert a bit to Base64 character

I need to convert a binary String (“110100”, 52 in decimal) to its corresponding Base64 character, that I know is “0”. Is any way in Java to do that? I was reading multiple base 64 …

Convert base64 string to image

I am trying to crop/resize user profile image using jquery plugin namely crop.js which sends user image as base64 via ajax to my controller as but I unable to decode this base64 string as Image,Can you guys guide me how can I save my base64 string as image on my server?. Answer This assumes a few things, that you know

Does anyone know how to decode and encode a string in Base64 using Base64?

I am using the following code, but it’s not working. Answer First: Choose an encoding. UTF-8 is generally a good choice; stick to an encoding which will definitely be valid on both sides. It would be rare to use something other than UTF-8 or UTF-16. Transmitting end: Encode the string to bytes (e.g. text.getBytes(encodingName)) Encode the bytes to base64 using

How to get the JAR file for sun.misc.BASE64Encoder class?

I have some code in my Activity class that uses sun.misc.BASE64Encoder class. But it is showing java.lang.NoClassDefFoundError : sun.misc.BASE64Encoder. Do I need the jar? Where can I download it from? Answer Don’t use sun.* classes. For Base64 in Android, use its native class or add a library to your project that does this (Apache commons, etc.). Alternatively just copy the