<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Подсчет md5 хеш-суммы]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=12037&amp;type=atom" />
	<updated>2016-09-30T16:00:30Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=12037</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подсчет md5 хеш-суммы]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=108128#p108128" />
			<content type="html"><![CDATA[<p>Отличная консольная версия:</p><p><a href="https://idrassi.github.io/DirHash">https://idrassi.github.io/DirHash</a></p><p>Алгоритмы:<br />MD5, SHA1, SHA256, SHA384, SHA512</p><p>Выдает hash не только отдельных файлов, но и всего содержимого директории. Рекомендую.</p>]]></content>
			<author>
				<name><![CDATA[freeZer0K]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34228</uri>
			</author>
			<updated>2016-09-30T16:00:30Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=108128#p108128</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подсчет md5 хеш-суммы]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=108040#p108040" />
			<content type="html"><![CDATA[<p><strong>Alectric</strong> Спасибо, чудно работает.</p>]]></content>
			<author>
				<name><![CDATA[NektoN95]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32518</uri>
			</author>
			<updated>2016-09-27T03:29:57Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=108040#p108040</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подсчет md5 хеш-суммы]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=108021#p108021" />
			<content type="html"><![CDATA[<p>Была где-то тема, не могу найти, но вот код которым пользуюсь:<br /></p><div class="codebox"><pre><code>#SingleInstance,Force
SetBatchLines,-1
SetWorkingDir,%A_ScriptDir%
onexit,exit

par:=%0%
if !par
{
  msgbox,Воспользуйтесь контекстным меню`nлюбого файла в проводнике &quot;Hash MD5&quot;.
  SplitPath,A_ScriptFullPath,,,Ext
  if ext=ahk
    RegWrite,REG_SZ,HKCR,*\shell\Hash MD5\command,,&quot;%a_ahkpath%&quot; &quot;%A_ScriptFullPath%&quot; &quot;`%1&quot;
  else
    RegWrite,REG_SZ,HKCR,*\shell\Hash MD5\command,,%A_ScriptFullPath% &quot;`%1&quot;
  exitapp
}

RegRead,old_file,HKCR,*\shell\Hash MD5,tmp1
RegRead,old_MD5,HKCR,*\shell\Hash MD5,tmp2

param=%1%
if param=
  file:=A_ScriptFullPath
else
  file:=param

MD5:=FileMD5(file)
if (MD5=old_MD5)
  chek=Одинаковые файлы...
else
  chek=!!! Разные файлы !!!

MsgBox,Текущий файл`n%file%`n`n%MD5%`n%old_MD5%`n`n%old_file%`nПредыдущий файл`n`n`t%chek%
clipboard=%MD5%

RegWrite,REG_SZ,HKCR,*\shell\Hash MD5,tmp1,%file%
RegWrite,REG_SZ,HKCR,*\shell\Hash MD5,tmp2,%MD5%


FileMD5(sFile=&quot;&quot;, cSz=4) {  ; by SKAN www.autohotkey.com/community/viewtopic.php?t=64211
 cSz := (cSz&lt;0||cSz&gt;8) ? 2**22 : 2**(18+cSz), VarSetCapacity( Buffer,cSz,0 )
 hFil := DllCall( &quot;CreateFile&quot;, Str,sFile,UInt,0x80000000, Int,3,Int,0,Int,3,Int,0,Int,0 )
 IfLess,hFil,1, Return,hFil
 hMod := DllCall( &quot;LoadLibrary&quot;, Str,&quot;advapi32.dll&quot; )
 DllCall( &quot;GetFileSizeEx&quot;, UInt,hFil, UInt,&amp;Buffer ),    fSz := NumGet( Buffer,0,&quot;Int64&quot; )
 VarSetCapacity( MD5_CTX,104,0 ),    DllCall( &quot;advapi32\MD5Init&quot;, UInt,&amp;MD5_CTX )
 Loop % ( fSz//cSz + !!Mod( fSz,cSz ) )
   DllCall( &quot;ReadFile&quot;, UInt,hFil, UInt,&amp;Buffer, UInt,cSz, UIntP,bytesRead, UInt,0 )
 , DllCall( &quot;advapi32\MD5Update&quot;, UInt,&amp;MD5_CTX, UInt,&amp;Buffer, UInt,bytesRead )
 DllCall( &quot;advapi32\MD5Final&quot;, UInt,&amp;MD5_CTX )
 DllCall( &quot;CloseHandle&quot;, UInt,hFil )
 Loop % StrLen( Hex:=&quot;123456789ABCDEF0&quot; )
  N := NumGet( MD5_CTX,87+A_Index,&quot;Char&quot;), MD5 .= SubStr(Hex,N&gt;&gt;4,1) . SubStr(Hex,N&amp;15,1)
Return MD5, DllCall( &quot;FreeLibrary&quot;, UInt,hMod )
}

exit:
param=%1%
if param=
  file:=A_ScriptFullPath
else
  file:=param
MD5:=FileMD5(file)
RegWrite,REG_SZ,HKCR,*\shell\Hash MD5,tmp1,%file%
RegWrite,REG_SZ,HKCR,*\shell\Hash MD5,tmp2,%MD5%

exitapp
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Alectric]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26027</uri>
			</author>
			<updated>2016-09-26T16:40:03Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=108021#p108021</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Подсчет md5 хеш-суммы]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=108007#p108007" />
			<content type="html"><![CDATA[<p>Нужна консольная утилита или ahk функция считающая хеш файла. Важно что бы в выводе не было всякого мусора, вроде ссылок на сайт разраба и т. п. Нужно только полное имя файла и его хеш-сумма в одну строку. Смотрел функции под ahk на забугорном сайте, все найденные мной функции почему-то не работают, а у консолек дурацкая форма записи выводного файла. Help, люди.</p>]]></content>
			<author>
				<name><![CDATA[NektoN95]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32518</uri>
			</author>
			<updated>2016-09-26T06:12:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=108007#p108007</id>
		</entry>
</feed>
