Hash 0.6 - Sha256 and sha512 support

Discuss and share scripts and script files...
Post Reply
40k
Posts: 234
Joined: 09 Dec 2011 21:25

Hash 0.6 - Sha256 and sha512 support

Post by 40k » 07 Feb 2013 14:21

Hash 0.6 - Sha256 and sha512 support
hash.xys
(4.11 KiB) Downloaded 238 times
To use the script you will require:

1. Xyplorer 7.0 or higher. The script is not tested for earlier versions but may work.

How to use:

1. Place Hash.xys into the <xypath>\Data\Scripts folder
2. Create a catalog entry to load the script or make your own toolbar button
3. Select files in Xyplorer that you wish to checksum
4. Choose from 3 possible checksum formats as displayed below

Development History:

CURRENT VERSION: 0.6

Changelog:

Code: Select all

V0.6
+ support for hashing with SHA256 and SHA512 algorythms.

V0.5
+ Switched most of the code to HEREDOC format.
+ Added new script feature: "Compare to known checksum"
> This new feature will first display a text input box. You can input any amount of text that contains checksums for the files you are about to hash. Usually these checksums come from a trusted source, such as the website where you are downloading your files from, or from a .NFO file.
> The script will automatically calculate checksums and compare them to the checksums you provided.
> When matches are found this is clearly indicated in the report text box that appears when the script is done.

! Caution: Checksum matching only indicates the file on your hard drive is an exact copy of the file on the server. It does not provide any information on whether this file is safe or not. Always verify your checksums are coming from an official source. Try doing a Google search for your MD5 and SHA1 sum. If Google does not find any results and your file is a software package, be suspicious.
Image

Image

Image

Image

0.4 - 11
0.5 - 38
Last edited by 40k on 05 Dec 2014 16:35, edited 9 times in total.
I develop scripts that integrate media functionality into Xyplorer.
Hash - Twitch.tv in VLC (NEW 2.0!) - FFmpeg GUI - Youtube downloading
XYplorer for Linux! Tutorial

Marco
Posts: 2266
Joined: 27 Jun 2011 15:20

Re: Hash script with multiple modes

Post by Marco » 07 Feb 2013 15:20

You really helped me because I really needed to quickly calculate a bunch of hashes! Here's the result, bottom of top message. Thank you!
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

PeterH
Posts: 2579
Joined: 21 Nov 2005 20:39
Location: Germany

Re: Hash script with multiple modes

Post by PeterH » 08 Feb 2013 01:35

Just a bit to syntax...

I didn't look for function, but only for form. I think your code isn't bad or so. Just 2 minor things.

Instead of get("SelectedItemsPathNames",|,a) you should write get("SelectedItemsPathNames","|","a") - both "|" and "a" are strings and should be specified quoted.

Even original help sometimes shows this wrong, for example 2 consecutive lines show:
echo get("bytesselected", i); //inactive pane's sel. bytes
text get("selecteditemsnames", , "i"); //inactive pane's sel. items, one per line
Specifying a string unquoted may work today, but not work tomorrow...


And a bit of optimization: in double quotes you can specify variables. So e.g. instead of

Code: Select all

   $c = $c . $hashedfilename <crlf> . "Size  : " . $checksize . <crlf> ."MD5   : ". $checkmd5 . <crlf> . "SHA-1 : " . $checksha1 . <crlf> . "CRC32 : " . $checkcrc32 .<crlf 2>;
you might write

Code: Select all

  $c = "$c$hashedfilename<crlf>Size  : $checksize<crlf>MD5   : $checkmd5<crlf>SHA-1 : $checksha1<crlf>CRC32 : $checkcrc32<crlf 2>";
But be careful: the name of a variable in double quotes must be followed by a character that's not allowed in variable names, (like $ or blank,) so

Code: Select all

   $c = $c."Google: ".$g_AboutResults2." hits<crlf 2>";
can be changed to

Code: Select all

   $c = $c."Google: $g_AboutResults2 hits<crlf 2>";
where the leading $c cannot be integrated into the quotes. (It would become the variable name $cGoogle) If you could add a blank in front of Google it would be possible...

Edit: some typo :oops:
W7(x64) SP1 German
( +WXP SP3 )

40k
Posts: 234
Joined: 09 Dec 2011 21:25

Re: Hash script with multiple modes

Post by 40k » 08 Feb 2013 11:14

Thanks for the pointers Peter!
I develop scripts that integrate media functionality into Xyplorer.
Hash - Twitch.tv in VLC (NEW 2.0!) - FFmpeg GUI - Youtube downloading
XYplorer for Linux! Tutorial

Enternal
Posts: 1171
Joined: 10 Jan 2012 18:26

Re: Hash script with multiple modes

Post by Enternal » 09 Feb 2013 21:19

This is really awesome! It works well and pretty fast too! Hmm... just a suggestion but it might be easier if you mark when you updated your script. As of now, it's hard to tell if you have updated your script or not unless we actually compare the code. Anyway thank you very much for this useful script!

40k
Posts: 234
Joined: 09 Dec 2011 21:25

Re: Hash 0.4 - New update

Post by 40k » 07 Jun 2013 15:25

Updated this one.
I develop scripts that integrate media functionality into Xyplorer.
Hash - Twitch.tv in VLC (NEW 2.0!) - FFmpeg GUI - Youtube downloading
XYplorer for Linux! Tutorial

40k
Posts: 234
Joined: 09 Dec 2011 21:25

Re: Hash 0.5 - New compare Hash to trusted source feature

Post by 40k » 03 Jul 2013 14:46

New feature in 0.5!
I develop scripts that integrate media functionality into Xyplorer.
Hash - Twitch.tv in VLC (NEW 2.0!) - FFmpeg GUI - Youtube downloading
XYplorer for Linux! Tutorial

RalphM
Posts: 1256
Joined: 27 Jan 2005 23:38
Location: Cairns, Australia

Re: Hash 0.5 - New compare Hash to trusted source feature

Post by RalphM » 04 Jul 2013 02:02

It would make life easier for the users of your scripts if you could put some version info in the header of the script files and maybe name the download files accordingly too.
Ralph :-)
(OS: W10 1809 Home x64 - XY: Current beta)

40k
Posts: 234
Joined: 09 Dec 2011 21:25

Re: Hash 0.6 - Sha256 and sha512 support

Post by 40k » 05 Dec 2014 16:36

I gave this one an update that's long overdue. There's support now for hasing with SHA 256 and 512.
I develop scripts that integrate media functionality into Xyplorer.
Hash - Twitch.tv in VLC (NEW 2.0!) - FFmpeg GUI - Youtube downloading
XYplorer for Linux! Tutorial

Post Reply