base64

Saving a Base64 string to disk as a binary using PHP

As a "look under the covers" tutorial for myself I am building a PHP script to gather emails from a POP3 mailbox. While attempting to make use of binary attachments I am stuck trying to figure out what to do with the attachment information. Given a string that would be gathered from an email: ------=_Part_16735_17392833.12296539921...

Embed javascript as base64

Hello, I'm working on a small GreaseMonkey script where I would like to embed a jQuery plugin (Markitup) so that the script is fully self contained (images + js) except for jQuery who is served from google. I found the site http://www.greywyvern.com/code/php/binary2base64 wich says that you can embed javascript with the href if you base...

Any base64 library on iphone-sdk?

I'd like to do base64 encoding and decoding. But I could not find any support from iPhone SDK. Any suggestion? Thanks. ...

Does Flex support the data uri scheme?

I wish to pass many small PNG files as base64 encoded URIs within an XML response, but there seems to be no way to make flex present these images. I was thinking of the data uri scheme, but it appears not to be supported. Proposed solutions Use Loader.LoadBytes Tried it and it doesn't seem to work (none of the events are triggered)....

adobe flex problem with Base64Encoder

Hi, in the following code : var benq:Base64Encoder = new Base64Encoder(); benq.encode("force",0,5); var tmp:String = benq.toString(); 'tmp' turns out to be an empty string, i.e. with length 0. why? how to encode a string using base64encoder? ...

urlsafe_b64encode always ends in '=' ?:

I think this must be a stupid question, but why do the results of urlsafe_b64encode() always end with a '=' for me? '=' isn't url safe? from random import getrandbits from base64 import urlsafe_b64encode from hashlib import sha256 from time import sleep def genKey(): keyLenBits = 64 a = str(getrandbits(keyLenBits)) b = urlsafe...

How do you remove the padding from Modifed Base 64 for URL?

This Wiki article on Base64 URL says "For this reason, a modified Base64 for URL variant exists, where no padding '=' will be used, and the '+' and '/' characters of standard Base64 are respectively replaced by '-' and '_', so that using URL encoders/decoders is no longer necessary and has no impact on the length of the encoded value, ...

Decode Base64 data in java

I have an image that is base64 encoded. What is the best way to decode that in Java? Hopefully using only the libraries included with Sun Java 6. ...

RegEx to parse or validate Base64 data

Is it possible to use a RegEx to validate, or sanitize Base64 data? That's the simple question, but the factors that drive this question are what make it difficult. I have a Base64 parser that can not fully RELY on the input data to follow the RFC specs. So, the issue I face is maybe b64 data that is not broke into 78 (I think it's 78...

Base64 Encode a PDF in C#?

Can someone provide some light on how to do this? I can do this for regular text or byte array, but not sure how to approach for a pdf. do i stuff the pdf into a byte array first? ...

Base64 Encode String in VBScript

I have a web service load driver that's a Windows Script File (WSF), that includes some VBScript and JavaScript files. My web service requires that the incoming message is base64 encoded. I currently have a VBScript function that does this, but it's very inefficient (memory intensive, mostly due to VBScripts awful string concatenation) ...

Storing base64 data in XML?

How I can store base64 strings in XML? Do you use CDATA to store base64 strings in XML? Would it help as it allows use of < > within the strings? Is base64 configurable where you tell it not to use certain chars if they conflict with XML? ...

Use CDATA to store raw binary streams?

Instead of the overhead with saving binary as Base64, I was wondering if you could directly store double-byte binary streams into XML files, using CDATA, or commenting it out, or something? ...

Flex 3 - how to support HTTP Authentication URLRequest?

I have a Flex file upload script that uses URLRequest to upload files to a server. I want to add support for http authentication (password protected directories on the server), but I don't know how to implement this - I assume I need to extend the class somehow, but on how to I'm a little lost. I tried to modify the following (replacin...

Base 64 encode vs loading an image file.

So I am working on something in php where I have to get get my images from a sql database where they will be encoded in base64. The speed of displaying these images is critical so I am trying to figure out if it would be faster turn the database data into an image file and then load it in the browser, or just echo the raw base64 data and...

What is the best format to store images in a database?

What is the best format to store images in a database, such as binary,base64...etc, for optimal speed/size. ...

Reimplement ASP.NET Membership and User Password Hashing in Ruby

I have a large database of users (~200,000) that I'm transferring from a ASP.NET application to a Ruby on Rails application. I don't really want to ask every user to reset their password and so I'm trying to re-implement the C# password hashing function in Ruby. The old function is this: public string EncodePassword(string pass, strin...

How to convert an integer to the shortest url-safe string in Python?

I want the shortest possible way of representing an integer in a URL. For example, 11234 can be shortened to '2be2' using hexadecimal. Since base64 uses is a 64 character encoding, it should be possible to represent an integer in base64 using even less characters than hexadecimal. The problem is I can't figure out the cleanest way to con...

base64 and UTF-8 encoding issue

Hello everyone, I am writing a simple web method which returns byte[], and the byte[] is encoded by UTF-8. I have investigated related WSDL and soap message, seems the underlying web services stack will use base64 encoding? For various reasons, I can not use or re-encode my return byte[] from UTF-8 to base64. Any ideas to modify the ba...

decode base64 with dollar sign in ruby 1.8.5

Hello, I have base64-encoded string (with two dollar signs, so it's not a common base64 string) The problem: Base64.decode64 (or .unpack("m")) decodes it just fine on my local machine(ruby 1.8.6), but with ruby 1.8.5 (the version used by Heroku) it doesn't work Any ideas ? edit: I have : $$YTo1OntzOjM6Im1pZCI7czo3OiI3MTE5Njg3IjtzOj...