Difference between revisions of "LlBase64ToString"

From Second Life Wiki
Jump to navigation Jump to search
(spacing)
(return_text=that is the {{LSLGC|Base64}} '''str''' decoded into a conventional string, interpreting the Base64-encoded bytes as UTF-8 character sequence.)
 
(4 intermediate revisions by 3 users not shown)
Line 3: Line 3:
|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 {{LSLGC|Base64}} '''str''' decoded into a conventional string.
|return_text=that is the {{LSLGC|Base64}} '''str''' decoded into a conventional string, interpreting the Base64-encoded bytes as UTF-8 character sequence.
|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=
<lsl>default {
<source lang="lsl2">default {
     state_entry()
     state_entry()
     {
     {
Line 14: Line 14:
         llSay(0,test );
         llSay(0,test );
     }
     }
}</lsl>
}</source>


This can be used in {{Wikipedia|Basic access authentication|Basic Authentication}}, such as this login:
This can be used in {{Wikipedia|Basic access authentication|Basic Authentication}}, such as this login:
Line 23: Line 23:
Authorization: Basic U2VjcmV0Ok9wZW4=  
Authorization: Basic U2VjcmV0Ok9wZW4=  
</pre>
</pre>
<lsl>llBase64ToString("U2VjcmV0Ok9wZW4="); //will return the string "Secret:Open"</lsl>
<source lang="lsl2">llBase64ToString("U2VjcmV0Ok9wZW4="); //will return the string "Secret:Open"</source>
|helpers
|helpers
|related
|related
Line 29: Line 29:
|also_events
|also_events
|also_functions=
|also_functions=
{{LSL DefineRow||[[llXorBase64]]|Article also discusses xor based Cryptography.}}
{{LSL DefineRow||[[llStringToBase64]]|}}
{{LSL DefineRow||[[llStringToBase64]]|}}
{{LSL DefineRow||[[llBase64ToInteger]]|}}
{{LSL DefineRow||[[llBase64ToInteger]]|}}

Latest revision as of 09:15, 24 January 2024

Summary

Function: string llBase64ToString( string str );
0.0 Forced Delay
10.0 Energy

Returns a string that is the Base64 str decoded into a conventional string, interpreting the Base64-encoded bytes as UTF-8 character sequence.

• string str Base64 string

Caveats

  • If the conversion creates any unprintable characters, they are converted to spaces.
  • Converts invalid characters into question marks ('?').

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

Signature

function string llBase64ToString( string str );