using System.Reflection; using Kreta.BusinessLogic.Classes.MobileApi.Naplo.V2.Converter; namespace Kreta.BusinessLogic.Classes.MobileApi.Naplo.V2.Logic { public static class HashLogic { private static string GetNonce() => Assembly.GetExecutingAssembly().GetName().Version.ToString().Replace(".", "_"); public static string CreateSourceHash(T responseCO) where T : class, new() => (responseCO != null) ? CustomJsonConverter.SerializeObjectToJson(responseCO)?.GetHashCode().ToString() + "__" + GetNonce() : null; //public static string CreateResponseHash(T responseCO, string requestHash) where T : class, IGetResponseCo, new() // => (responseCO != null && !responseCO.Hash.Equals(requestHash)) ? responseCO.Hash : null; //public static T CreateResponseData(T responseCO, string requestHash) where T : class, IGetResponseCo, new() // => (responseCO != null && !responseCO.Hash.Equals(requestHash)) ? responseCO : null; } }