Difference between revisions of "LlBase64ToString"

From Second Life Wiki
Jump to navigation Jump to search
m
(18 intermediate revisions by 13 users not shown)
Line 1: Line 1:
{{LSL_Function
{{LSL Function
|func_id=261|func_sleep=0.0|func_energy=10.0
|func=llBase64ToString|func_id=261|func_sleep=0.0|func_energy=10.0
|func=llBase64ToString|sort=Base64ToString
|return_type=string
|return_type=string
|p1_type=string|p1_name=str|p1_desc=Base64 string
|p1_type=string|p1_name=str|p1_desc=Base64 string
|return_text=that is the {{LSLG|Base64}} '''str''' decoded into a conventional string.
|return_text=that is the {{LSLGC|Base64}} '''str''' decoded into a conventional string.
|caveats=*If the conversion creates any unprintable characters, they are converted to spaces.
|caveats=*If the conversion creates any unprintable characters, they are converted to spaces.
*Converts invalid characters into question marks ('?').
*Converts invalid characters into question marks ('?').
|spec
|spec
|examples
|examples=
<source lang="lsl2">default {
    state_entry()
    {
        string test = llBase64ToString("U2VjcmV0Ok9wZW4=");
        llSay(0,test );
    }
}</source>
 
This can be used in {{Wikipedia|Basic access authentication|Basic Authentication}}, such as this login:
<pre>
GET / HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2)
Host: www.example.com
Authorization: Basic U2VjcmV0Ok9wZW4=
</pre>
<source lang="lsl2">llBase64ToString("U2VjcmV0Ok9wZW4="); //will return the string "Secret:Open"</source>
|helpers
|helpers
|related
|related
|also_header
|also_header
|also_events
|also_events
|also_functions={{LSL DefineRow||[[llGround]]|Gets the ground height}}
|also_functions=
|also_articles={{LSL DefineRow||{{LSLG|Base64}}|}}
{{LSL DefineRow||[[llXorBase64]]|Article also discusses xor based Cryptography.}}
{{LSL DefineRow||[[llStringToBase64]]|}}
{{LSL DefineRow||[[llBase64ToInteger]]|}}
|also_articles=
{{LSL DefineRow||{{LSLGC|Base64}}|}}
|also_footer
|also_footer
|notes
|notes
Line 20: Line 39:
|deprecated
|deprecated
|cat1=Base64
|cat1=Base64
|cat2
|cat2=String
|cat3
|cat3
|cat4
|cat4
}}
}}

Revision as of 00:07, 22 January 2015

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

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

This can be used in "Wikipedia logo"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= 
llBase64ToString("U2VjcmV0Ok9wZW4="); //will return the string "Secret:Open"

See Also

Functions

•  llXorBase64 Article also discusses xor based Cryptography.
•  llStringToBase64
•  llBase64ToInteger

Articles

•  Base64

Deep Notes

Search JIRA for related Issues

Signature

function string llBase64ToString( string str );