base64

C# Method like Base64String, but only alphanumeric (no plus or slash)

Hello, is there any C# method that works similar to Convert.ToBase64String but doesn't generate anything except alphanumeric output? Thanks! ...

Get image data in Javascript?

I have a regular HTML page with some images (just regular IMG HTML tags). I'd like to get their content, base64 encoded preferably, without the need to redownload the image (ie. it's already loaded by the browser, so now I want the content). I'd love to achieve that with Greasemonkey and Firefox. ...

How to encode string in Oracle?

Hello, I have problem with encoding data in Oracle database. I want to xor string with another string (mask) and then encode it with base64. In Python this looks like: def encode_str(s, mask): xor_mask = mask while len(xor_mask) < len(s): xor_mask += mask chrs2 = [] for i in range(len(s)): chrs2.append(chr(or...

NSImage to Base64

I need to create a base64 string representation of an NSImage cocoa object. What's the best way of handling this, apple documentation seems to be a little short on the subject (or I just cant find it). Base64 encoding seems rather complex from the outside. Any help would be very much appreciated. Cheers Alex EDIT NSArray *keys = [NSA...

smime C# encrypted emails with attchments

I need to send encrypted emails using C# without using any third party component. This is pretty much working as long as I do not need attchments on the email but as soon as I add attchments, I face the same problem as described on http://social.msdn.microsoft.com/forums/en-US/netfxnetcom/thread/74e4711e-1f66-43a7-9e3b-bc9cfbcd1b73/ The...

storing hashed passwords - base64, or hex string, or something else?

I am hashing password using the .NET System.Security.Cryptography class. It has a few algorithms for hashing, e.g. MD5, SHA1, SHA256, SHA384, SHA512 The resultant hashed value is a byte array. Should i convert it to a hex string for storing, or Convert.ToBase64String(), or to something else? (I am favoring Base64 as it is shorter than H...

How do I read an image from a base64 encoded string in Objective C?

I'm getting a XML containing image which is base64 encoded.I've to decode that & need to display a image.Any suggestions............. ...

Should I be leery of using boost::archive?

I want to use boost::archive::iterators::base64_from_binary. But I can't seem to figure out why it is under "archive." What does this imply? Should I be leery of using this code for any reason? Thanks-- ...

What is the purpose of hex-encoding for binary data?

I'm a bit curious as to why one would want to use hex encoding over base64. It seems to me that base 64 is more efficient. In particular, why is it that databases seem to always use hex encoding? Is it a historical issue, or am I missing something about hex encoding? ...

guid to base64, for URL

Question: is there a better way to do that? VB.Net Function GuidToBase64(ByVal guid As Guid) As String Return Convert.ToBase64String(guid.ToByteArray).Replace("/", "-").Replace("+", "_").Replace("=", "") End Function Function Base64ToGuid(ByVal base64 As String) As Guid Dim guid As Guid base64 = base64.Replace("-", "/").Re...

What is the size of the memory area pointed to by an unsigned char *?

Ok, I know this has been asked before but after searching I couldn't find a proper answer. I need to convert a buffer (unsigned char *) to base64, the base64 function I am using takes as paramters: void Base64Enc(const unsigned char *src, int srclen, unsigned char *dest) where int srclen is the length of the src string. My question ...

Setting the src attribute of an IFrame to data:application/pdf;base64?

Setting the src attribute of an IFrame to data:application/pdf;base64, isn't working for me, any ideas why? Here's the .aspx markup <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> <sc...

Pointer initializiation? for a specific function.

Alright, this one's been puzzling me for a bit. the following function encodes a string into base 64 void Base64Enc(const unsigned char *src, int srclen, unsigned char *dest) { static const unsigned char enc[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; unsigned char *cp; int i; cp = dest...

How do you take an image (passed in as a Base64 encoded string) and save it to the server in Asp.Net C#?

I want to create a function like this... [AcceptVerbs(HttpVerbs.Post)] public ActionResult SaveImage(string file, string fileName) { } Where the file is the Base64 encoded string created from the image, and the fileName is the name I want to save it as. How can I use this encoded string to write the image to the serve...

Best API/LIB for encoding/decoding base64/quoted-printable in Java

Possible Duplicate: Decode Base64 data in java Thanks to everyone in advance, I am aware of http://commons.apache.org/codec/api-release/org/apache/commons/codec/binary/Base64.html etc, can anyone point to me another option preferably one that does not require me to use external libraries. Thanks, Sam ...

Converting binary file to Base64 string.

Hi, I need to convert uploaded binary files to base64 string format on the fly. I'm using ASP, Vbscript. Using Midori's component for base64 conversion. For small size files (<20K) the performance is okay. But when it exceeds 75 or 100K, its totally lost. Is there any efficient way to convert big binary files (2MB) to base64 string form...

embedding background image data into css as base64, good or bad practice

The other day I was looking at the source of a greasemonkey userscript and noticed the following in their css: .even { background: #fff url(data:image/gif;base64,R0lGODlhBgASALMAAOfn5+rq6uvr6+zs7O7u7vHx8fPz8/b29vj4+P39/f///wAAAAAAAAAAAAAAAAAAACwAAAAABgASAAAIMAAVCBxIsKDBgwgTDkzAsKGAhxARSJx4oKJFAxgzFtjIkYDHjwNCigxAsiSAkygDAgA7) repeat-x b...

Php Imageresize Performance Question

I'm working on an image resize script for php, and had a few questions.. Currently I'm pulling an external URL as the image, and don't really want to store the new image that is going to be re-sized on my server. Here is what I'm trying to do: Have the script resize the image, than encode it the resized image in base64 on the fly. No...

Has anyone gotten IE8 to read DHTML behaviors encoded as base64'd data URIs?

Here is the HTC content I'm encoding (nothing fancy): <public:component> <script type="text/javascript"> alert('data URI'); </script> </public:component> Here is the definition in the CSS file, with the above component base64'd: .something { -ms-behavior: url(data:text/x-component;base64,PHB1YmxpYzpjb21wb25lbnQ+PHNjcmlwdC...

How to save a base64 string as an image using ruby

I'm integrating my Ruby on Rails app with a usps shipping system. Once you make a postage request, you pay for that postage and it's nonrefundable. Postage requests will return you an xml response including a base64 string, which is the shipping label. I'm able to render the shipping label in a view, however to make it foolproof, I w...