Difference between revisions of "LlBase64ToString"

From Second Life Wiki
Jump to navigation Jump to search
m
m (That table doesn't make sense for this article.)
Line 7: Line 7:
*Converts invalid characters into question marks ('?').
*Converts invalid characters into question marks ('?').
|spec
|spec
|examples=<pre>
|examples=
This can be used in Basic Authentication, such as this login
<lsl>default {
    state_entry()
    {
        string test = llBase64ToString("U2VjcmV0Ok9wZW4=");
        llSay(0,test );
    }
}</lsl>


This can be used in Basic Authentication, such as this login:
<pre>
GET / HTTP/1.1
GET / HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2)
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2)
Host: www.example.com
Host: www.example.com
Authorization: Basic U2VjcmV0Ok9wZW4=  
Authorization: Basic U2VjcmV0Ok9wZW4=  
llBase64ToString("U2VjcmV0Ok9wZW4=");
will return the string "Secret:Open"
</pre>
</pre>
<lsl>
<lsl>llBase64ToString("U2VjcmV0Ok9wZW4="); //will return the string "Secret:Open"</lsl>
default {
    state_entry()
    {
        string test = llBase64ToString("U2VjcmV0Ok9wZW4=");
        llSay(0,test );
    }
}
</lsl>
 
|helpers
|helpers
|related
|related
|also_header
|also_header
|also_events
|also_events
|also_functions={{LSL DefineRow||[[llStringToBase64]]|}}
|also_functions=
{{LSL DefineRow||[[llStringToBase64]]|}}
{{LSL DefineRow||[[llBase64ToInteger]]|}}
{{LSL DefineRow||[[llBase64ToInteger]]|}}
|also_articles={{LSL DefineRow||{{LSLGC|Base64}}|}}
|also_articles=
{{LSL DefineRow||{{LSLGC|Base64}}|}}
|also_footer
|also_footer
|notes
|notes
Line 47: Line 42:
|cat4
|cat4
}}
}}
<div id="box">
== Character Ranges ==
<div style="padding: 0.5em;">
{|{{Prettytable}}
|+
|-{{Hl2}}
!Decimal value
!Hex value
|-
|| 10 || 0xA
|-
|| 32 -> 127 || 0x20 -> 0x7F
|}
</div></div>

Revision as of 05:58, 8 July 2008

Summary

Function: string llBase64ToString( string str );

Returns a string that is the Base64 str decoded into a conventional string.

• string str Base64 string

Caveats

  • If the conversion creates any unprintable characters, they are converted to spaces.
  • Converts invalid characters into question marks ('?').
All Issues ~ Search JIRA for related Bugs

Examples

<lsl>default {

   state_entry()
   {
       string test = llBase64ToString("U2VjcmV0Ok9wZW4=");
       llSay(0,test );
   }

}</lsl>

This can be used in Basic Authentication, such as this login:

GET / HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2)
Host: www.example.com
Authorization: Basic U2VjcmV0Ok9wZW4= 
<lsl>llBase64ToString("U2VjcmV0Ok9wZW4="); //will return the string "Secret:Open"</lsl>

See Also

Functions

•  llStringToBase64
•  llBase64ToInteger

Articles

•  Base64

Deep Notes

Search JIRA for related Issues

Signature

function string llBase64ToString( string str );