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)); }
internal static ulong Hash64_NoCache_forBenchmarks <T>(T o) { IEnumerable <Func <object, IEnumerable <byte> > > functions; functions = BuildHashFunctionsWrapped <T>(ACCEPT_ALL).Select(f => f.Compile()).ToList(); var bytes = functions.SelectMany(f => f(o)).ToArray(); return(Farmhash.Hash64(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); }