Search the Community
Showing results for tags 'null'.
-
I am really having a headache with this one... ; #FUNCTION# ==================================================================================================================== ; Name ..........: _Base64_Encode ; Description ...: Encode the $vData in Base64 ; Syntax ........: _Base64_Encode($vData) ; Parameters ....: $vData - $vData to Encode. ; Return values .: Success: Base64 encoded $vData in the form of a string. ; Failure: False and @error set to: ; 1 - If "error calculating the length of the buffer needed" ; 2 - If "error encoding" ; Author ........: trancexx ; Modified ......: Damon Harris (TheDcoder) ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _Base64_Encode($vData) $vData = Binary($vData) Local $tByteStruct = DllStructCreate("byte[" & BinaryLen($vData) & "]") DllStructSetData($tByteStruct, 1, $vData) Local $tIntStruct = DllStructCreate("int") Local $aDllCall = DllCall("Crypt32.dll", "int", "CryptBinaryToString", _ "ptr", DllStructGetPtr($tByteStruct), _ "int", DllStructGetSize($tByteStruct), _ "int", 1, _ "ptr", 0, _ "ptr", DllStructGetPtr($tIntStruct)) If @error Or Not $aDllCall[0] Then Return SetError(1, 0, False) ; error calculating the length of the buffer needed EndIf Local $tCharStruct = DllStructCreate("char[" & DllStructGetData($tIntStruct, 1) & "]") $aDllCall = DllCall("Crypt32.dll", "int", "CryptBinaryToString", _ "ptr", DllStructGetPtr($tByteStruct), _ "int", DllStructGetSize($tByteStruct), _ "int", 1, _ "ptr", DllStructGetPtr($tCharStruct), _ "ptr", DllStructGetPtr($tIntStruct)) If @error Or Not $aDllCall[0] Then Return SetError(2, 0, False) ; error encoding EndIf Return DllStructGetData($tCharStruct, 1) EndFunc ConsoleWrite(_Base64_Encode("jilles" & Null & "jilles" & Null & "sesame")) ; It should be "amlsbGVzAGppbGxlcwBzZXNhbWU=" Sleep(1000) Thanks in Advance, TD.
-
Here is some code: ConsoleWrite("Test" == "Test" & Null) ; This should be False by theory, but it is True in AutoIt Sleep(1000) ; Sometime for you to read the result Is this a bug or expected behaviour? Thanks in Advance, TD