Difference between revisions of "LlXorBase64StringsCorrect"

From Second Life Wiki
Jump to navigation Jump to search
m
 
(38 intermediate revisions by 10 users not shown)
Line 1: Line 1:
{{LSL_Function
{{LSL_Function
|deprecated=llXorBase64
|inject-2={{Issues/SVC-289}}{{Issues/SCR-35|fc=*}}
|func_id=319|func_sleep=0.0|func_energy=10.0
|func_id=319|func_sleep=0.0|func_energy=10.0
|func=llXorBase64StringsCorrect|return_type=string
|func=llXorBase64StringsCorrect|sort=XorBase64StringsCorrect
|return_type=string
|p1_type=string|p1_name=str1|p1_desc=Base64 string
|p1_type=string|p1_name=str1|p1_desc=Base64 string
|p2_type=string|p2_name=str2|p2_desc=Base64 string
|p2_type=string|p2_name=str2|p2_desc=Base64 string
|func_footnote='''str2''' repeats if it is shorter than '''str1'''. If the inputs are not Base64 strings the result will be erratic.
|func_footnote={{LSLP|str2}} repeats if it is shorter than {{LSLP|str1}}. If the inputs are not Base64 strings the result will be erratic.
|func_desc=Correctly performs an exclusive or on two Base 64 strings.
|func_desc=Correctly performs an exclusive or on two Base 64 strings.
|return_text=that is a Base64 XOR of '''str1''' and '''str2'''.
|return_text=that is a Base64 XOR of {{LSLP|str1}} and {{LSLP|str2}}.
|spec
|spec
|caveats
|caveats=
* During the conversion to a byte array the last <code>(bitcount % 8)</code> are discarded from both {{LSLP|str1}} and {{LSLP|str2}}. See [[#Implementation|Implementation]] for details.
* Considers any null encountered in {{LSLPT|str2}} to mark the end of {{LSLPT|str2}}.
|constants
|constants
|examples
|helpers
|helpers
|also_functions
|also_functions
|also_events
|also_events
|also_tests
|also_tests
|also_articles=*[[User:SignpostMarv_Martin/LSL2/llXorBase64StringsCorrect|llXorBase64StringsCorrect in PHP]]
|also_articles
|notes
|permission
|negative_index
|cat1=Base64
|cat2=Encoding
|cat3
|cat4=Stub
}}
}}

Latest revision as of 23:38, 24 June 2013

Emblem-important.png Deprecated
(This function has been deprecated, please use llXorBase64 instead.)

Summary

Function: string llXorBase64StringsCorrect( string str1, string str2 );

Correctly performs an exclusive or on two Base 64 strings.
Returns a string that is a Base64 XOR of str1 and str2.

• string str1 Base64 string
• string str2 Base64 string

str2 repeats if it is shorter than str1. If the inputs are not Base64 strings the result will be erratic.

Caveats

  • This function has been deprecated, please use llXorBase64 instead.
  • During the conversion to a byte array the last (bitcount % 8) are discarded from both str1 and str2. See Implementation for details.
  • Considers any null encountered in str2 to mark the end of str2.

Important Issues

~ All Issues ~ Search JIRA for related Bugs
   llXorBase64StringsCorrect returns wrong result when the 2nd string contains nulls

Examples

Deep Notes

All Issues

~ Search JIRA for related Issues
   llXorBase64StringsCorrect zero out last (bitcount % 8) bits of data.
   llXorBase64StringsCorrect returns wrong result when the 2nd string contains nulls

Signature

function string llXorBase64StringsCorrect( string str1, string str2 );