MadBoy Posted February 26, 2008 Posted February 26, 2008 (edited) Sometime ago on forum I saw the example how to use the CRC32 (http://www.autoitscript.com/forum/index.php?showtopic=60890). So what i did is made it usable the same way that Total Commander does it, along with other minor programs for .sfv creating/verifying. All credits go to LazyCat and Laszlo for this. checksum_verify_1.0.au3 checksum_creator_1.0.au3 Enjoy, MadBoy Edited February 26, 2008 by MadBoy My little company: Evotec (PL version: Evotec)
ken0137 Posted March 10, 2008 Posted March 10, 2008 good job i can use it to check the download software of phone
MadBoy Posted March 11, 2008 Author Posted March 11, 2008 good job i can use it to check the download software of phoneNo problem. That's what it was for ;-) Or well in my case i'm also doing crc creation of .gho files. My little company: Evotec (PL version: Evotec)
sc4ry Posted December 29, 2009 Posted December 29, 2009 (edited) hey, nice job. but there must be an error in your verifier. i create an sfv file, deletes some letters from checksums in the sfv-file and let it check. verifier says that everything is fine ... but this can´t be (verifier does not check a file). PS: Found the Error. Its caused in this line: If $sfv_line_split[0] = 2 Then because, what, if a file contains space in the name? than this is > 2 ;-) PPS: my solution: Dim $sfv_line_split[3] $sfv_line_split[2] = StringTrimLeft($sfv_file_list[$a], StringInStr($sfv_file_list[$a], " ", 0, -1)) $sfv_line_split[1] = StringTrimRight($sfv_file_list[$a], StringLen($sfv_line_split[2])+1) Edited December 29, 2009 by sc4ry
MadBoy Posted December 30, 2009 Author Posted December 30, 2009 hey, nice job. but there must be an error in your verifier. i create an sfv file, deletes some letters from checksums in the sfv-file and let it check. verifier says that everything is fine ... but this can´t be (verifier does not check a file). PS: Found the Error. Its caused in this line: If $sfv_line_split[0] = 2 Then because, what, if a file contains space in the name? than this is > 2 ;-) PPS: my solution: Dim $sfv_line_split[3] $sfv_line_split[2] = StringTrimLeft($sfv_file_list[$a], StringInStr($sfv_file_list[$a], " ", 0, -1)) $sfv_line_split[1] = StringTrimRight($sfv_file_list[$a], StringLen($sfv_line_split[2])+1) That's why downloadable files shouldn't have spaces. URL's don't like it, ftp sites dont like it :-) If you have to use space use _ . or whatever just don't use real space :-) My little company: Evotec (PL version: Evotec)
kisstom Posted September 2, 2020 Posted September 2, 2020 Can you please share the fixed code? Thanks
Trong Posted September 2, 2020 Posted September 2, 2020 Code is 12 years old, I don't know if he's up to date anymore. You can try other UDFs similarly: On 7/5/2009 at 5:06 AM, KaFu said: There are these excellent functions: MD5,SHA1,CRC32,RC4,BASE64,XXTEA machine code versions by Ward and CRC32, MD4, MD5, SHA1 by WinAPI by trancexx... Regards,
kisstom Posted September 2, 2020 Posted September 2, 2020 Thanks, I just figured out: expandcollapse popupFunc _ChecksumVerify($sFileSFV) ; Returns 0 if success ; Returns $array of failed files if there was at least one failure ; Return 1 if file doesn't exists or something else is wrong with the file Local $sfv_file_list Local $sfv_failed[1], $sfv_passed[1] Local $sFileSFVDirectory = StringLeft($sFileSFV, StringInStr($sFileSFV, "\", 1, -1) - 1) Local $status = _FileReadToArray($sFileSFV, $sfv_file_list) If $status = 0 Then Return SetError(1, 0, -1) For $a = 1 To $sfv_file_list[0] If StringLeft($sfv_file_list[$a], 1) <> ";" And StringLeft($sfv_file_list[$a], 1) <> "" Then $sfv_line_split = StringSplit($sfv_file_list[$a], " ", 1) Dim $sfv_line_split[3] $sfv_line_split[2] = StringTrimLeft($sfv_file_list[$a], StringInStr($sfv_file_list[$a], " ", 0, -1)) $sfv_line_split[1] = StringTrimRight($sfv_file_list[$a], StringLen($sfv_line_split[2])+1) ;If $sfv_line_split[0] = 2 Then $checksum_return = _ChecksumGetInfo($sFileSFVDirectory & "\" & $sfv_line_split[1]) If $checksum_return = $sfv_line_split[2] Then ;ConsoleWrite(@CR & $sfv_line_split[1] & " -> PASSED") _ArrayAdd($sfv_passed, $sfv_line_split[1]) Else ;ConsoleWrite(@CR & $sfv_line_split[1] & " -> FAILED") _ArrayAdd($sfv_failed, $sfv_line_split[1]) EndIf ;EndIf EndIf Next $sfv_failed[0] = UBound($sfv_failed) - 1 $sfv_passed[0] = UBound($sfv_passed) - 1 If $sfv_failed[0] = 0 Then Return 0 Else Return $sfv_failed EndIf EndFunc ;==>_ChecksumVerify
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now