Questions tagged [base64]

Base64 is a set of encoding schemes that represent binary data in an ASCII string format.

Base64 is a group of similar encoding schemes that represent binary data in an ASCII string format by translating it into a radix-64 representation. The Base64 term originates from a specific MIME content transfer encoding.

Base64 uses characters 0 to 9, A to Z and a to z to represent digits of 64-decimal numbers. The last two required digits differ between schemas. For instance, MIME (RFC 2045) uses + and / , XML names tokens use - and ., XML identifiers use _ and : and regular expressions use ! and -.

When encoding in Base64 text, 3 bytes are typically encoded into 4 characters. To encode arbitrary lengths, the padding character (=) is used. = at the end of encoded sequence means that only two bytes and == means that only one byte is encoded by the last 4 character group.

Characters outside the discussed alphabet are normally forbidden, except in MIME where they are discarded.

Base64 encoding schemes are commonly used when there is a need to encode binary data that need to be stored and transferred over media that are designed to deal with textual data. This is to ensure that the data remain intact without modification during transport. Base64 is commonly used in a number of applications including email via MIME, or to store binary data in textual formats such as XML or JSON.

Useful online tools

They work without enabled JavaScript too.

11149 questions
4
votes
2 answers

Encoding base64 in Java and decoding in C#

I have to send a file to my webservice, but the webservice assumes the file (byte Array) as a base64Binary. Before the encoding, the byteArrayFile is saved on disk as a regular File. (I'm doing it just for testing) So, in my Java client for…
CalypsOOO
  • 73
  • 2
  • 11
4
votes
1 answer

Convert 'String' to Base64 encode of MD5 'String' in c# .net

How can i Convert my password 'String' to Base64 encode of MD5 'String'. Like this string 'password' to 'X03MO1qnZdYdgyfeuILPmQ=='. Please help me here OR just let me know the technique that how can i convert this 'password' to…
Zaid Iqbal
  • 1,662
  • 5
  • 25
  • 45
4
votes
1 answer

Go base64 image decode

Im currently getting a base64 image data url from a canvas something like this (not the dataurl im getting just to show how the string looks like) data:image/png;base64,iVkhdfjdAjdfirtn= I need to decode that image to check the width and the height…
Raggaer
  • 3,244
  • 8
  • 36
  • 67
4
votes
1 answer

Base64 SVG Fails to render in Chrome, Works in Firefox

I'm attempting to create an image from a svg on a page. However, I was unable to get the svgToImage() function working on google chrome. I switched browsers to firefox, and everything generated without any issues. Firefox seems to generate a…
4
votes
1 answer

Base64 encoding or bin2hex random string

When converting "random bytes" to a string, is there any difference as to whether I should use base64_encode or bin2hex? $bytes = openssl_random_pseudo_bytes(32); // alternatively read from /dev/urandom echo base64_encode($bytes); // some 44…
rink.attendant.6
  • 44,500
  • 61
  • 101
  • 156
4
votes
2 answers

Trouble decoding tiled base64 data with javascript

I'm using tiled to create a tile map. (Tiled is a tile map editor with support for orthogonal and isometric maps) It saves the map in an XML file. It can use certain encoding structures: regular base64 base64 + gzip base64 + zlib regular csv Now,…
Jelle De Loecker
  • 20,999
  • 27
  • 100
  • 142
4
votes
1 answer

Extract cover image from OGG file

I need to extract cover from OGG file. I'm tries to decode base64 string stored in METADATA_BLOCK_PICTURE tag, which I'm getting with following command: vorbiscomment -R -e 1.ogg Base64 decoding is working without errors, but resulting binary file…
Beer Brother
  • 514
  • 2
  • 6
  • 15
4
votes
2 answers

Base64 encode file by chunks

I want to split a file into multiple chunks (in this case, trying lengths of 300) and base64 encode it, since loading the entire file to memory gives a negative array exception when base64 encoding it. I tried using the following code: int offset =…
Adrian Veliz
  • 124
  • 1
  • 7
4
votes
2 answers

How to replace all images in an html file with their base64-codes? (Powershell)

I use a software called Belarc Avisor, that provides an html output of all the hardware-software details including licenses/keys/serials of installed software in an html format. I usually create this report from this software either on a new PC or…
mk117
  • 753
  • 2
  • 13
  • 26
4
votes
2 answers

How to convert a Base64 encoded string to UUID format

How can I convert a Base64 encoded string to a hex encoded string with dashes(basically to uuid format)? For example if I have 'FWLalpF2T5mmyxS03Q+hNQ0K' then how can I convert it to: 1562da96-9176-4f99-a6cb-14b4dd0fa135
user3075906
  • 725
  • 1
  • 8
  • 19
4
votes
2 answers

Java Mail MimeUtility encodeText UnsupportedEncodingException BASE64

As part of my J2EE application's email service, I encode into BASE64 body = MimeUtility.encodeText(orig_mail_body,"UTF-8","BASE64"); but in some circumstances it's throwing an exception: java.io.UnsupportedEncodingException: Unknown transfer…
Black
  • 5,023
  • 6
  • 63
  • 92
4
votes
1 answer

How to decode base64 encoded image with JS/PHP? (previously encoded with Actionscript)

I have an image encoded to base64, made with an ActionScript function: private static const BASE64_CHARS:String = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; public static function encodeByteArray(_arg1:ByteArray):String { …
ByGiro
  • 41
  • 1
  • 4
4
votes
2 answers

Inline images in CSS with background-image: url ()

I'm trying to load a gif file within my .css file, like this: li.box_entry { background-image:…
JochenJung
  • 7,183
  • 12
  • 64
  • 113
4
votes
1 answer

AFNetworking 2.0: How to pass complete json param argument converted as base64encoded + urlencoded string for AFNetworking 2.0 Post Request

I am using AFNetworking 2.0 & new to it. Tried couple of sample WS calls with success. We have Web Service implemented & to be called like: It's data parameter is encrypted string. Request is: http://demo.XYZ.net/getlanguage // Just for…
Niraj
  • 1,939
  • 20
  • 29
4
votes
1 answer

Normal image Vs base 64 image

Lets suppose I have an image called - myImage.png and I'm using it with the tag or as a background-image it doesn't really matter: So I decide to convert it as a base 64 image: .myImage { background: 0…
Chun
  • 2,230
  • 5
  • 24
  • 46