using System.Security.Cryptography;
public static void Main(string[] args)
string ruleIn = "command.users.tags.remove..inhibit";
string ruleOut = "command.users.tags.remove..inhibited";
var key = "HolderId,UserId,Tag,Family";
var sb = new StringBuilder();
sb.Append(String.Join(",", key.Split(',').Select(field => user.GetType().GetProperties().First(x => x.Name == field).GetValue(user))));
var result = new Sha256HashProvider().Hash(sb.ToString());
Console.WriteLine(result);
public class Sha256HashProvider
public string Hash(string value)
using (var algorithm = new SHA256Cng())
var hashBytes = algorithm.ComputeHash(Encoding.Unicode.GetBytes(value));
hash = BitConverter.ToString(hashBytes).Replace("-", string.Empty);