Все вопросы: [encode]
36 вопросов
Почему Reddit использует base36 для идентификатора статьи?
Почему Reddit использует base36 для идентификатора статьи? Например: a2xki
Отправка переменных в php из Cocoa Touch на iPhone sdk
Привет, я пытаюсь передать переменные на php из приложения. <?php // get email address $email = $_GET['email']; // get character name $character = $_GET['character']; // get password $charname = $_GET['charname']; // set up variables $id = 0; $idtest="no"; // set up database connection $li...
converting from base 10 to base 31 (working only with select characters)
I'd like to convert base 10 numbers to base 31 I would like to use only these characters: 23456789abcdefghjkmnpqrstuvwxyz As you can see, 5 characters are excluded (i don't need these): 1 0 o l i The function I have now is below but of course it doesn't work. When 2 is input it outputs 4. The ...
jQuery parsing RSS and namespaced element like <encoded></encoded>
I am using jQuery to parse an RSS feed. Within each <item> is a namespaced element like <content:encoded> I want to select. How do I select it in jQuery? $(xml).find('item') works but $(xml).find('item content') does not.
Convert from hex string to unicode
How can i convert the 'dead' string to an unicode string u'\xde\xad'? Doing this: from binascii import unhexlify out = ''.join(x for x in [unhexlify('de'), unhexlify('ad')]) creates a <type 'str'> string '\xde\xad' Trying to use the Unicode.join() like this: from binascii import unhex...
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...
Problem with json_encode()
i have an simple array: array 0 => string 'Kum' (length=3) 1 => string 'Kumpel' (length=6) when I encode the array using json_encode(), i get following: ["Kum","Kumpel"] My question is, what is the reason to get ["Kum","Kumpel"] instead of { "0" : "Kum", "1" : "Kumpel" }?
Encrypt in C# decrypt in JavaScript
I am looking for way to encrypt string in C# and to decrypt it using JavaScript. JavaScript in this case is a scripting language for internal system, so I should not worry about people accessing private key/password which will be required for decryption. Searching online for solution it seems t...
AJAX POST and Plus Sign ( + ) -- How to Encode?
I'm POSTing the contents of a form field via AJAX to a PHP script and using JavaScript to escape(field_contents). The problem is that any plus signs are being stripped out and replaced by spaces. How can I safely 'encode' the plus sign and then appropriately 'decode' it on the PHP side?
Proper replacement for usage of the Sun internal com.sun.image.codec.jpeg package?
We have some code kicking around that uses this old internal Sun package for manipulating images, essentially encoding JPEGs to a specific size and quality after reading in / decoding from an inputstream. Code examples below. I would appreciate a best practice replacement example using proper j...
Search form url structure
We are building a large search interface with close to 70 properties. Most of these properties are boolean (only hold 0 or 1), around 12 are with int values and some are string. goal: http://www.example.com/q/test_search/fdgREGd3vfS323 want to avoid: http://www.example.com/q/test_search/?val_12=...
passing special characters with encodeURI in javascript
I have an HTML input field linked to a button with an onclick function in javascript that can pass the textfield value to a textfield of another page. While passing the values from one page to another via an URL request of a JSP, I found out that encoding the values with encodeURI() gets: £ --&...
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...
How do I encode UTF-8 using the XStream framework?
Per XStream's FAQ its default parser does not preserve UTF-8 document encoding, and one must provide their own encoder. How does one do this? Thanks!
QR codes image generator in java (open source but no GPL)
I'm seeking an open source QR codes image generator component in java (J2SE), but the open source licence mustn't be a GPL licence (needs to be included in a close source project). BTW, i can't access the web from the project so no Google API.
Why doesn't my decrypt function work?
This was not written by me; it was written by someone who passed it down to me. I lost contact with the author of the code. I have been using this code for a few years and just now realized this error. It seems that the letter sequence rkey1 messes up the output. For example turkey1 outputs as ...
Как я могу перепроектировать используемый здесь метод кодирования / декодирования?
У меня есть страница для кодирования и страница для декодирования. Однако я не знаю, как сделать это сам без веб-страниц. Я пытаюсь выяснить, как закодировать ссылку типа: http://geoffreyf6.earth4.hop.clickbank.net в http://8e5250ieuas1d9b9bo6c6p8xat.hop.clickbank.net/ Стран...
Массив байтов SHA-1 кодирования Java
У меня есть массив байтов SHA-1, который я хотел бы использовать в запросе GET. Мне нужно это закодировать. URLEncoder ожидает строку, и если я создам ее, а затем закодирую, она будет повреждена? Чтобы уточнить, это своего рода продолжение другого моего вопроса. ( Запрос Bitorrent Tracker ) Я...
Java Чтение недекодированного URL-адреса из сервлета
Предположим, что у меня есть строка вида '= &? /; # +%', которая является частью моего URL, скажем так: example.com/servletPath/someOtherPath/myString/something.html?a=b&c=d#asdf где myString - указанная выше строка. Я закодировал критическую часть, поэтому URL-адрес выглядит как ...
Как закодировать строку в Oracle?
У меня проблема с кодированием данных в базе данных Oracle. Я хочу выполнить xor строку с другой строкой (маской), а затем закодируйте его с помощью base64. В Python это выглядит так: def encode_str(s, mask): xor_mask = mask while len(xor_mask) < len(s): xor_mask += mask...
кодирование URL с помощью функции Flex navigatetoUrl
Я хочу отправлять данные по URL-адресу на моем сервере из приложения Flex. Я использую следующее UrlParam = UrlParam + '&name='+ name.text + '&business=' + buisness.text; navigateToURL(new URLRequest(UrlParams),'_self'); Проблема, с которой я столкнулся, заключается в том, что есл...
Идеи создания небольшого (<10 цифр), не (очень) безопасного «хеша»
Я работаю над онлайн-системой продажи билетов на мероприятия, где пользователи смогут самостоятельно распечатать свои билеты и появиться на мероприятии, где они будут отсканированы (штрих-код) и, в идеале, человек войдет. Моя проблема в том, как создать «код билета», отвечающий следующим требова...
Обязательно ли «экранировать» символы «» для строки javascript?
Sometimes, server side will generate strings to be embedded in inline JavaScript code. For example, if "UserName" should be generated by ASP.NET. Then it looks like. <script> var username = "<%UserName%>"; </script> This is not safe, because a user can have his/her name to...
проблема с загрузкой файла
Я реализую аналогичный сценарий, такой как Youtube, для своего веб-сайта - загружаю видео, чтобы все люди могли его смотреть. Мой вопрос: я думаю, нам нужно закодировать видео после загрузки, прежде чем другие люди смогут играть удаленно, но процесс кодирования очень медленный (я пробовал исполь...
Как HTML кодировать / экранировать строку? Есть ли встроенный?
У меня есть ненадежная строка, которую я хочу показать как текст на HTML-странице. Мне нужно избежать символов «<» и «&» как объектов HTML. Чем меньше суеты, тем лучше. Я использую UTF8, и мне не нужны другие сущности для букв с диакритическими знаками. Есть ли встроенная функция в ...
Причина видео артефакта / артефакта
! [альтернативный текст] [1] На приведенном выше снимке экрана показаны некоторые артефакты, возникающие во время программного декодирования видеофайла .DV, совместимого с SMPTE 314m ... Считается, что причиной артефактов является проблема с коэффициентом постоянного / переменного тока. Вер...
Кодирование / декодирование электронной почты сайта публикации SharePoint
Я создаю сайт публикации SharePoint (MOSS) для информации о сотрудниках на сайте моей компании. У меня есть тип контента сотрудника, и я использую столбец сайта Контактный адрес электронной почты для хранения адреса электронной почты сотрудника. Я бы хотел, чтобы у меня была возможность кодир...
Какая библиотека для шифрования и дешифрования паролей лучше всего подходит для Perl?
Я пишу Perl-скрипт, который управляет zip-файлами, защищенными паролем. Следовательно, для этого мне нужно хранить и извлекать пароли. У меня есть три варианта хранения пароля: Хранить в виде обычного текста. Прежде чем вы начнете, я почти исключил этот вариант. Используйте простую утилиту...
Python UnicodeDecodeError - Я неправильно понимаю кодировку?
Есть мысли, почему это не работает? Я действительно думал, что "игнорировать" будет правильным решением. >>> 'add \x93Monitoring\x93 to list '.encode('latin-1','ignore') Traceback (most recent call last): File "<interactive input>", line 1, in ? UnicodeDecodeError: 'ascii' co...