|
|
|
@ -7,6 +7,8 @@ namespace OpenSubtitlesHandler
|
|
|
|
|
public class MovieHasher
|
|
|
|
|
{
|
|
|
|
|
public static byte[] ComputeMovieHash(Stream input)
|
|
|
|
|
{
|
|
|
|
|
using (input)
|
|
|
|
|
{
|
|
|
|
|
long lhash, streamsize;
|
|
|
|
|
streamsize = input.Length;
|
|
|
|
@ -27,11 +29,11 @@ namespace OpenSubtitlesHandler
|
|
|
|
|
i++;
|
|
|
|
|
lhash += BitConverter.ToInt64(buffer, 0);
|
|
|
|
|
}
|
|
|
|
|
input.Close();
|
|
|
|
|
byte[] result = BitConverter.GetBytes(lhash);
|
|
|
|
|
Array.Reverse(result);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static string ToHexadecimal(byte[] bytes)
|
|
|
|
|
{
|
|
|
|
|