Ejemplo n.º 1
0
        public static ulong CalculateTypeCheckValue(System.Type t)
        {
            var check = new TypeHasher();

            check.AddType(t);
            return(check.Value);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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()));
 }