Difference between revisions of "Category:LSL Base64"
m |
Ibrew Meads (talk | contribs) (Added a description of Base64.) |
||
Line 1: | Line 1: | ||
{{LSL Header|ml=*}}{{LSLC|}}{{LSLC|Encoding}} | {{LSL Header|ml=*}}{{LSLC|}}{{LSLC|Encoding}} | ||
== About Base64 encoding == | |||
Base64 conversion expands three bytes of arbitrary binary data into four bytes of common ASCII characters in a completely reversible algorithm. It is generally used to convert binary data to strings so they can be sent across a text interface where ASCII control characters might be misinterpreted as end of string (\0) newline (\n) or otherwise not be transferred properly to the receiving process. In LSL this might be used to store binary data in an object's description, break data into bytes for cryptographic processing, or send data from one process to another using chat or linked messages. | |||
Base64 input can be any sequence of bytes, the output consists exclusively of uppercase and lowercase letters, digits and the plus (+), slash (/) and equals (=) characters. Conversion to Base64 is done in blocks of three bytes (24 bits), padded if needed. These twenty-four bits are split into four six bit numbers which become an index to the conversion key ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/") and written out as the eight bit ASCII character. Since the data is converted three bytes at a time, zero one or two equals characters are added to indicate how much padding was done in the last block. See [http://en.wikipedia.org/wiki/Base64 the Wikipedia article] for more information. | |||
== Examples == | |||
String and integer data in Base64. | |||
<div align="left"> | |||
{| style="border:1px solid #A3B1BF; text-align:left; background:#f5faff" | |||
|- | |||
| width="50%" style="background: #cee0f2; padding: 0.3em; text-align:center;"|'''Text''' | |||
| style="background: #cee0f2; padding: 0.3em; text-align:center;"|'''Base64''' | |||
|- | |||
|Abcde | |||
|QWJjZGU= | |||
|- | |||
|ⓐⓑⓒⓓⓔ | |||
|4pOQ4pOR4pOS4pOT4pOU | |||
|- | |||
|12345 (as an integer) | |||
|AAAwOQ== | |||
|} |
Revision as of 17:55, 21 October 2012
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
About Base64 encoding
Base64 conversion expands three bytes of arbitrary binary data into four bytes of common ASCII characters in a completely reversible algorithm. It is generally used to convert binary data to strings so they can be sent across a text interface where ASCII control characters might be misinterpreted as end of string (\0) newline (\n) or otherwise not be transferred properly to the receiving process. In LSL this might be used to store binary data in an object's description, break data into bytes for cryptographic processing, or send data from one process to another using chat or linked messages.
Base64 input can be any sequence of bytes, the output consists exclusively of uppercase and lowercase letters, digits and the plus (+), slash (/) and equals (=) characters. Conversion to Base64 is done in blocks of three bytes (24 bits), padded if needed. These twenty-four bits are split into four six bit numbers which become an index to the conversion key ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/") and written out as the eight bit ASCII character. Since the data is converted three bytes at a time, zero one or two equals characters are added to indicate how much padding was done in the last block. See the Wikipedia article for more information.
Examples
String and integer data in Base64.
Text | Base64 |
Abcde | QWJjZGU= |
ⓐⓑⓒⓓⓔ | 4pOQ4pOR4pOS4pOT4pOU |
12345 (as an integer) | AAAwOQ== |
Pages in category "LSL Base64"
The following 5 pages are in this category, out of 5 total.