public static ulong CalculateTypeCheckValue(System.Type t) { var check = new TypeHasher(); check.AddType(t); return(check.Value); }
public void MethodTaskVoidHash() { var hash = TypeHasher.GetMethodString(new Type[] { typeof(int) }, typeof(void)); var thash = TypeHasher.GetMethodString(new Type[] { typeof(int) }, typeof(Task)); Assert.IsNotNull(hash); Assert.AreEqual(hash, thash); }
public void MethodTaskHash() { var hash = TypeHasher.GetMethodString(new Type[] { typeof(int) }, typeof(CalculatorResult)); var thash = TypeHasher.GetMethodString(new Type[] { typeof(int) }, typeof(Task <CalculatorResult>)); Assert.IsNotNull(hash); Assert.AreEqual(hash, thash); }
public void MethodTaskGenericArrayHash() { var hash = TypeHasher.GetMethodString(new Type[] { typeof(int) }, typeof(Tuple <Tuple <CalculatorResult> >[])); var thash = TypeHasher.GetMethodString(new Type[] { typeof(int) }, typeof(Task <Tuple <Tuple <CalculatorResult> >[]>)); Assert.IsNotNull(hash); Assert.AreEqual(hash, thash); }
public static byte[] GetId(this object obj) { return(TypeHasher.GetHash(obj.GetType())); }