<PackageReference Include="Relativity.Server.Transfer.SDK" Version="7.7.0" />

PrimaryKeyGenerator

using Relativity.Transfer.Resources; using System; using System.Security.Cryptography; using System.Text; namespace Relativity.Transfer { internal class PrimaryKeyGenerator : ITransferPathKeyGenerator { private static readonly object SyncRoot = new object(); public static long CreateKey(TransferPath path) { if (path == (TransferPath)null) throw new ArgumentNullException("path"); return CreateKey(path.SourcePath); } public static long CreateKey(string path) { if (string.IsNullOrEmpty(path)) throw new ArgumentNullException("path", CoreStrings.SourcePathArgumentExceptionMessage); lock (SyncRoot) { using (SHA256 sHA = SHA256.Create()) return BitConverter.ToInt64(sHA.ComputeHash(Encoding.UTF8.GetBytes(path.ToUpperInvariant())), 0); } } public long GetKey(string path) { return CreateKey(path); } public long GetKey(TransferPath path) { return CreateKey(path); } } }