Все вопросы: [base64]

104 вопросов

похожие теги:
54
голосов
6ответов
55382 просмотров

How to encode media in base64 given URL in Ruby

I'm trying to upload an image to PingFM. Their documentation says: media – base64 encoded media data. I can access this image via the URL. I tried (practically guessed) this: ActiveSupport::Base64.encode64(open("http://image.com/img.jpg")) But I get this error: TypeError: can't convert Tem...

27
голосов
9ответов
36182 просмотров

Calculate the size to a Base 64 encoded message

I have a binary string that I am encoding in Base 64. Now, I need to know before hand the size of the final Base 64 encoded string will be. Is there any way to calculate that? Something like: BinaryStringSize is 64Kb EncodedBinaryStringSize will be 127Kb after encoding. Oh, the code is in C. ...

1
голосов
3ответов
3590 просмотров

Given a string, how do I know if it needs decoding

I'm using python's base64 module and I get a string that can be encoded or not encoded. I would like to do something like: if isEncoded(s): output = base64.decodestring(s) else: output = s ideas?

5
голосов
5ответов
1997 просмотров

Is base64 considered encryption in an iPhone app?

Is simple base64 encoding (for posting binary data to apples validation servers) considered encryption and would I have to report this when uploading my app to the appstore?

3
голосов
1ответов
2842 просмотров

coding favicon in base64

hello i'm writing a GM user script and i want to change the favicon dynamically changing it the old way is easy but i want to encode it in base64 to avoid hosting it this is what i have done after hosting the favicon var link = document.createElement('link'); link.type = 'image/x-icon'; link.re...

2
голосов
4ответов
1761 просмотров

Why can't I round-trip from .png image to base64-encoded, back to .png image w/ PHP?

What I'm trying to do is simple and should be very straightforward in my mind. The results have been less than encouraging. What I'm trying to do: I have a web page that receives base64-encoded PNG image data. I can and have successfully taken that data through the proper steps to create an im...

629
голосов
15ответов
502114 просмотров

Binary Data in JSON String. Something better than Base64

The JSON format natively doesn't support binary data. The binary data has to be escaped so that it can be placed into a string element (i.e. zero or more Unicode chars in double quotes using backslash escapes) in JSON. An obvious method to escape binary data is to use Base64. However, Base64 has...

-5
голосов
1ответов
1565 просмотров

Base64 decoding - incorrect string length

I'm trying to decode base64-encoded string with openssl. However, it works only 4 times out of 5. Decoded string should always be 64 chars long. BIO_read() always returns 64. However, sometimes returned buffer is shorter than 64! Any ideas what is wrong? How can i always get the correct string?

6
голосов
5ответов
2690 просмотров

What character replacements should be performed to make base 64 encoding URL safe?

In looking at URL safe base 64 encoding, I've found it to be a very non-standard thing. Despite the copious number of built in functions that PHP has, there isn't one for URL safe base 64 encoding. On the manual page for base64_encode(), most of the comments suggest using that function, wrapped...

1
голосов
2ответов
5338 просмотров

HttpServerUtility.UrlTokenDecode fails "sometimes" (Invalid length for a Base-64 char array.)

We have an IHttpHandler for stylesheets and add a <link/> tag to the page like this: HtmlGenericControl link = new HtmlGenericControl("link"); link.Attributes.Add("rel", "stylesheet"); link.Attributes.Add("href", "stylesheet.axd?d=" + HttpServerUtility.U...

3
голосов
5ответов
1397 просмотров

Two Base64 encodings yield same decoding

Is it expected behavior that two encodings can map to the same decoding? I'm trying to troubleshoot a digital signature issue by doing sanity checks on base64-encoded intermediate strings. For example, the following base64 encoding: R0VUDQoNCg0KRnJpLCAwNCBTZXAgMjAwOSAxMTowNTo0OSBHTVQrMDA6MDANCi...

247
голосов
10ответов
292837 просмотров

Passing base64 encoded strings in URL

Is it safe to pass raw base64 encoded strings via GET parameters?

1
голосов
1ответов
1870 просмотров

How to display 'Base64' encoded image in Adobe AIR application using Javascript/HTML

I'm having some issues while displaying a 'Base64' encoded image in my AIR application. I'm fetching an image, which is 'Base64' encoded string, in a XML through a web service. At application side I'm able to decode it, but its not been able to display the image on the fly. A little search on Goo...

0
голосов
1ответов
730 просмотров

php to silverlight base64 encode/decode

My question is quite similar with this one. But it is php to silverlight. my php code (server encode): $str = 'This is the string'; $encoded = base64_encode($str); How could I achieved the decoded string in Silverlight 2?

0
голосов
2ответов
1865 просмотров

Base64 encoding on the iPhone, works in simulator, breaks on device

I am using the simple SMTP client code, first posted on google code at: http://code.google.com/p/skpsmtpmessage/ That repo seems to have gone unmaintained, as the project owner is now employed at apple, and maybe has better things to do. There is a fork of the code, that is more recently maint...

45
голосов
7ответов
49764 просмотров

How to base64 encode /dev/random or /dev/urandom?

cat /dev/urandom is always a fun way to create scrolling characters on your display, but produces too many non-printable characters. Is there an easy way to encode it on the command-line in such a way that all of its output are readable characters, base64 or uuencode for example. Note that I pr...

114
голосов
5ответов
93113 просмотров

Code for decoding/encoding a modified base64 URL

I want to base64 encode data to put it in a URL and then decode it within my HttpHandler. I have found that Base64 Encoding allows for a '/' character which will mess up my UriTemplate matching. Then I found that there is a concept of a "modified Base64 for URL" from wikipedia: A modified Base...

12
голосов
1ответов
4008 просмотров

Google App Engine "repackaged" package

What is the purpose of the classes in this package? I want to use Base64 encoding in my app. As I'm typing away in Eclipse, I am prompted if I want to import a class called "com.google.appengine.repackaged.com.google.common.util.Base64" I can't find any documentation about what this class does....

1
голосов
1ответов
1579 просмотров

Flex: Converting a GUID to Base64

In Flex, I have a GUID that I receive as input in the following format "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx" as a string. How would I convert this to a string of Base64 encoded values? Please note that we have to account for leading zeroes in each section of the GUID, for example, "0091AFBC-8558-4...

566
голосов
3ответов
653141 просмотров

Embedding Base64 Images

Purely out of curiosity, which browsers does Base64 image embedding work in? What I'm referring to is this. I realize it's not usually a good solution for most things, as it increases the page size quite a bit - I'm just curious. Some examples: HTML: <img alt="Embedded Image" src="data:ima...

4
голосов
4ответов
2091 просмотров

Base64 encoding for images

I am building a service using WCF and I need to send over images. I looked around on how this is done and found that Base64 encoding is often used to send binary data as text. Is this a good practice to send over images (~500 kb)?

52
голосов
4ответов
40976 просмотров

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...

0
голосов
1ответов
734 просмотров

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

Here is the HTC content I'm encoding (nothing fancy): Here is the definition in the CSS file, with the above component base64'd: .something { -ms-behavior: url(data:text/x-component;base64,PHB1YmxpYzpjb21wb25lbnQ+PHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFzY3JpcHQiPmFsZXJ0KCdiYXNlNjQnKTs8L3Njcml...

15
голосов
9ответов
21126 просмотров

How can I suppress java compiler warnings about Sun proprietary API

I'm using the encode() method from the sun.misc.BASE64Encoder package. How do I suppress the compiler warnings that it generates? sun.misc.BASE64Encoder is Sun proprietary API and may be removed in And as a followup, why don't I see this warning in Eclipse?

0
голосов
1ответов
545 просмотров

Php Imageresize Performance

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 t...

476
голосов
12ответов
171682 просмотров

Is embedding background image data into CSS as Base64 good or bad practice?

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///wAAAAAAAAAAAAAAAAAAACwAAAAABgASAAAIMAAVCBxIsKDBgwgTDkzAsKGAhxARSJx4oKJFAxgzFtjIkYDHjwNC...

5
голосов
6ответов
21770 просмотров

Преобразование двоичного файла в строку Base64

Мне нужно на лету конвертировать загруженные двоичные файлы в строковый формат base64. Я использую ASP, Vbscript. Использование компонента Midori для преобразования base64. Для файлов небольшого размера (<20 КБ) производительность нормальная. Но когда он превышает 75 или 100K, он полностью те...

1
голосов
4ответов
2663 просмотров

Лучший API / БИБЛИОТЕКА для кодирования / декодирования base64 / quoted-printable в Java

Возможный дубликат: Декодировать данные Base64 в java Заранее всем спасибо, Мне известно о http : //commons.apache.org/codec/api-release/org/apache/commons/codec/binary/Base64.html и т.д., может ли кто-нибудь указать мне другой вариант, желательно тот, который не требует от ме...

2
голосов
1ответов
2699 просмотров

Как взять изображение (переданное в виде строки в кодировке Base64) и сохранить его на сервере в Asp.Net C #?

Я хочу создать такую ​​функцию ... [AcceptVerbs(HttpVerbs.Post)] public ActionResult SaveImage(string file, string fileName) { } Где файл - это строка в кодировке Base64, созданная из изображения, а fileName - это имя, под которым я хочу его сохранить. Как я могу использо...

1
голосов
5ответов
218 просмотров

Инициализация указателя? для конкретной функции

Хорошо, это меня немного озадачило. следующая функция кодирует строку в базу 64 void Base64Enc(const unsigned char *src, int srclen, unsigned char *dest) { static const unsigned char enc[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; unsigned char *cp;...