Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "List hashes by file"
- {
- $Files = get('SelectedItemsPathNames', '|', 'a');
- $Report = '';
- global $g_Sha1;
- global $g_Md5;
- global $g_Crc;
- foreach($File, $Files)
- {
- $Name = getpathcomponent($File , 'file', );
- $Size = report('{Size B}', $File, , );
- $g_Crc = hash('crc32', $File, '1');
- $g_Md5 = hash('md5', $File, '1');
- $g_Sha1 = hash('sha1', $File, '1');
- $Report = <<<#
- $Report
- $Name
- ----------------------------------------
- Size: $Size Bytes
- CRC : $g_Crc
- MD5 : $g_Md5
- SHA : $g_Sha1
- #;
- }
- text $Report;
- }
- "List hashes by checksum"
- {
- $Files = get('SelectedItemsPathNames', '|', 'a');
- $Report = '';
- global $g_Sha1;
- global $g_Md5;
- global $g_Crc;
- /*
- * Hash: SHA1
- */
- $Report = "---------------Hash: SHA1---------------<crlf>";
- foreach($File, $Files)
- {
- $Name = getpathcomponent($File , 'file', );
- $Size = report('{Size B}', $File, , );
- $g_Sha1 = hash('sha1', $File, '1');
- $Report = "$Report$g_Sha1 $Name <crlf>";
- }
- $Report = "$Report<crlf>";
- /*
- * Hash: MD5
- */
- $Report = "$Report---------------Hash: MD5---------------<crlf>" ;
- foreach($File,$Files)
- {
- $Name = getpathcomponent($File , 'file', );
- $Size = report('{Size B}', $File, , );
- $g_Md5 = hash('md5', $File, '1');
- $Report = "$Report$g_Md5 $Name <crlf>";
- }
- $Report = "$Report<crlf>";
- /*
- * Hash: CRC32
- */
- $Report = "$Report---------------Hash: CRC---------------<crlf>" ;
- foreach($File,$Files)
- {
- $Name = getpathcomponent($File , 'file', );
- $Size = report('{Size B}', $File, , );
- $g_Crc = hash('crc32', $File, '1');
- $Report = "$Report$g_Crc $Name <crlf>";
- }
- $Report = "$Report<crlf>";
- text ($Report, '1000', '500', , , );
- }
- "Compare to known checksum"
- {
- $Files = get('SelectedItemsPathNames', '|', 'a');
- $Checksums = input ('Hash', 'Paste text containing known checksums below:', , 'm', , , );
- global $g_Sha1;
- global $g_Md5;
- global $g_Crc;
- $Report = '';
- foreach($File, $Files)
- {
- $Name = getpathcomponent($File , 'file', );
- $Size = report('{Size B}', $File, , );
- $g_Crc = hash('crc32', $File, '1');
- $g_Md5 = hash('md5', $File, '1');
- $g_Sha1 = hash('sha1', $File, '1');
- $Report = <<<#
- $Report$Name
- ----------------------------------------
- Size: $Size Bytes
- CRC : $g_Crc#;
- $Hit = regexmatches($Checksums, $g_Crc, '|', '0');
- if($Hit){
- $Report = <<<#
- $Report
- >HIT: $Hit#;
- }
- $Report = <<<#
- $Report
- MD5 : $g_Md5#;
- $Hit = regexmatches($Checksums, $g_Md5, '|', '0');
- if($Hit){
- $Report = <<<#
- $Report
- >HIT: $Hit#;
- }
- $Report = <<<#
- $Report
- SHA : $g_Sha1#;
- $Hit = regexmatches($Checksums, $g_Sha1, '|', '0');
- if($Hit){
- $Report = <<<#
- $Report
- >HIT: $Hit#;
- }
- $Report = <<<#
- $Report
- #;
- }
- text $Report;
- }
Advertisement
Add Comment
Please, Sign In to add comment