Esempio n. 1
0
 public static void Swallow <T>(this T target, Action <T> action)
 {
     Guarder.CheckNull(target, "target");
     Guarder.CheckNull(action, "action");
     try
     {
         action(target);
     }
     catch
     {
         //quiet
     }
 }
Esempio n. 2
0
        public long[] Hash(byte[] bytes)
        {
            Guarder.CheckNull(bytes);
            var hash = OFFSET_BASIS;

            foreach (var b in bytes)
            {
                unchecked
                {
                    hash *= FNV_PRIME;
                    hash ^= b;
                }
            }

            return(new [] { (long)hash });
        }