updates to static pipeline

This commit is contained in:
kayone
2014-08-30 13:40:21 -07:00
parent 059028da02
commit dbcabd6df6
7 changed files with 58 additions and 48 deletions

View File

@@ -0,0 +1,26 @@
using System.Security.Cryptography;
using NzbDrone.Common.Disk;
namespace NzbDrone.Common.Crypto
{
public class Md5HashProvider
{
private readonly IDiskProvider _diskProvider;
public Md5HashProvider(IDiskProvider diskProvider)
{
_diskProvider = diskProvider;
}
public byte[] ComputeHash(string path)
{
using (var md5 = MD5.Create())
{
using (var stream = _diskProvider.StreamFile(path))
{
return md5.ComputeHash(stream);
}
}
}
}
}