예제 #1
0
        public static ulong CalculateTypeCheckValue(System.Type t)
        {
            var check = new TypeHasher();

            check.AddType(t);
            return(check.Value);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
        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()));
 }