base64

How to decode sprop-parameter-sets in a H264 SDP?

What is the meaning of Base64 decoded bytes in sprop-parameter-sets in SDP for a h264 stream? How can I know the video size from this example? SDP example: sprop-parameter-sets=Z0IAKeNQFAe2AtwEBAaQeJEV,aM48gA== First part decoded from Base64 to Base16: 67 42 00 29 E3 50 14 07 B6 02 DC 04 04 06 90 78 91 15 Second part (comma separ...

Which SQL data type to store Base64 encoded file?

nvarchar(max), varchar(max), or should I really decode the string and put it in an image or blob or something? The longer version : (with all the juicy details) I've got a .Net SOAP web service, which saves records in a SQL 2008 DB. The service is going to be extended to accept an image, which (for better or worse) also needs to go int...

Why do we need to base64 encode images before transmitting?

I've seen many code fragments that base64 encode images before transmitting over HTTP protocol. I am wondering why do we need it? ...

Silverlight 4.0: How to convert byte[] to image?

public Image Base64ToImage(string base64String) { // Convert Base64 String to byte[] byte[] imageBytes = Convert.FromBase64String(base64String); MemoryStream ms = new MemoryStream(imageBytes, 0, imageBytes.Length); // Convert byte[] to Image ms.Write(imageBytes, 0, imageBytes.Length)...

Characters with jquery json

Hi everyone, I'm using jquery $.getJSON to retrieve list of cities. Everything works fine, but I'm from Estonia (probably most of you don't know much about this country =D) and we are using some characters like õ, ü. ä, ö. When I pass letters like this to callback function, I keep getting empty strings. I've tried to base64 encode(serv...

Using base64 encoding as a mechanism to detect changes

Is it possible to detect changes in the base64 encoding of an object to detect the degree of changes in the object. Suppose I send a document attachment to several users and each makes changes to it and emails back to me, can I use the string distance between original base64 and the received base64s to detect which version has the most...

Should a HTTP POST'ed file be base64 encoded?

I'm currently implementing a client application that POST's a file over HTTP and have implemented base64 encoding on the file's data parameter. However, it appears that when inspecting the traffic between a simple HTML page with a file upload form and the server that no Content-Transfer-Encoding header is sent in the body when describin...

Decoding base64 string?

I can't seem to decode this base64 string which is in the footer of a wordpress theme. I want to be able to add more to the footer. Any help appreciated, thanks! <?php eval(stripslashes(gzinflate(base64_decode("pVNRa9swEH7OYP/h1kG7PbiGwfaQuM7D1tCwsY42UAaBINsXWyD7hKTO87/vSXUct3PZYPKLdN/5vrvvk5Yp8JrNkkL+glwJay+2J7lCYdBsT9Ik5nj6+lVIGh+e7...

How to encrypt an NSString in Objective C with DES in ECB-Mode?

Hi, I am trying to encrypt an NSString in Objective C on the iPhone. At least I wan't to get a string like "TmsbDaNG64lI8wC6NLhXOGvfu2IjLGuEwc0CzoSHnrs=" when I encode "us=foo;pw=bar;pwAlg=false;" by using this key: "testtest". My problem for now is, that CCCrypt always returns "4300 - Parameter error" and I have no more idea why. Thi...

Inline base64 encoded link not working in Firefox

I have this link: <a href="data:application/pdf;base64,JVBERi0x...KJSVFT0YK">PDF</a> In Safari on MacOsX, clicking the link instantly opens the PDF. In Firefox 3.6.2, it doesn't. When I choose Download, it saves it as "u7WYuJME.pdf(2).part", which is a valid PDF file. When I choose "Open with Preview", it downloads it but does not ope...

How to scale an image (in data URI format) in JavaScript (real scaling, not using styling)

We are capturing a visible tab in a Chrome browser (by using the extensions API chrome.tabs.captureVisibleTab) and receiving a snapshot in the data URI scheme (Base64 encoded string). Is there a JavaScript library that can be used to scale down an image to a certain size? Currently we are styling it via CSS, but have to pay performance...

Should I use Base64 encoding or byte[] for returning binary data in .NET web service

I have a simple question. Should I return a byte-array or simply base64 encode my binary data, when exposing it through a web service in .NET? Is there any pros/cons with either method, which is mostly supported etc. ...

Is there a Base64Stream for .NET? where?

If I want to produce a Base64-encoded output, how would I do that in .NET? I know that since .NET 2.0, there is the ICryptoTransform interface, and the ToBase64Transform() and FromBase64Transform() implementations of that interface. But those classes are embedded into the System.Security namespace, and require the use of a TransformB...

Error: Bad Base64Coder input character

I am currently facing an error called Bad Base64Coder input character at ... Here is my code in java. String nonce2 = strNONCE; byte[] nonceBytes1 = Base64Coder.decode(nonce2); System.out.println("nonceByte1 value : " + nonceBytes1); The problem now is I get Bad Base64Coder input character error an...

Java to JavaScript (Encryption related)

Hi guys, I'm having difficulties to get the same string in Javascript and I'm thinking that I'm doing something wrong... Java code: import java.io.UnsupportedEncodingException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.Date; import java.util.GregorianCalendar; import sun.misc....

Detect base64 encoding in PHP?

Is there some way to detect if a string has been base64_encoded() in PHP? We're converting some storage from plain text to base64 and part of it lives in a cookie that needs to be updated. I'd like to reset their cookie if the text has not yet been encoded, otherwise leave it alone. ...

Can base64 encoding applied to multibyte utf-8 characters ?

Can base64 encoding applied to multibyte utf-8 characters ? How base64 encoded string is converted back to multibyte utf-8 string ? ...

Error: The magic number in GZip header is not correct

I have two methods, one that I use to convert an image to a Base64 string so I can store it in an XML tag and another to convert the Base64 string back to an image. I'm able to convert the image to a string and store it in the XML, but when I try to convert the string back to an image I'm getting the following error: "The magic number i...

tmpfile and gzip combination problem

I have problem with this code: file = tempfile.TemporaryFile(mode='wrb') file.write(base64.b64decode(data)) file.flush() os.fsync(file) # file.seek(0) f = gzip.GzipFile(mode='rb', fileobj=file) print f.read() I dont know why it doesn't print out anything. If I uncomment file.seek then error occurs: File "/usr/lib/python2.5/gzip.py"...

Strange \n in base64 encoded string in Ruby

The inbuilt Base64 library in Ruby is adding some '\n's. I'm unable to find out the reason. For this special example: irb(main):001:0> require 'rubygems' => true irb(main):002:0> require 'base64' => true irb(main):003:0> str = "1110--ad6ca0b06e1fbeb7e6518a0418a73a6e04a67054" => "1110--ad6ca0b06e1fbeb7e6518a0418a73a6e04a67054" irb(main)...