1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-24 22:35:49 -04:00

Now generating unique ids for queue items sent to the api.

This commit is contained in:
Taloth Saldono
2014-12-26 14:55:35 +01:00
parent 3c145c63f4
commit c19a393f99
6 changed files with 94 additions and 4 deletions
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
namespace NzbDrone.Common.Crypto
{
public static class HashConverter
{
private static SHA1 HashAlgorithm = SHA1.Create();
public static int GetHashInt31(string target)
{
var hash = HashAlgorithm.ComputeHash(Encoding.Default.GetBytes(target));
return BitConverter.ToInt32(hash, 0) & 0x7fffffff;
}
}
}