public static uint Hash32 <T>(T o, Func <System.Reflection.PropertyInfo, bool> propertyFilter) { List <Func <object, IEnumerable <byte> > > functions = GetCachedCompiledHashFunctions <T>(propertyFilter); var bytes = functions.SelectMany(f => f(o)).ToArray(); return(Farmhash.Hash32(bytes, bytes.Length)); }
public static int HashS32 <T>(T o, Func <System.Reflection.PropertyInfo, bool> propertyFilter) { List <Func <object, IEnumerable <byte> > > functions = GetCachedCompiledHashFunctions <T>(propertyFilter); var bytes = functions.SelectMany(f => f(o)).ToArray(); var uhash = Farmhash.Hash32(bytes, bytes.Length); var hash = BitConverter.ToInt32(BitConverter.GetBytes(uhash), 0); return(hash); }