예제 #1
0
        private static int ComputeHashMain(DatabaseConnection connection)
        {
            var persons = connection.ReadPersons();

            foreach (var personItems in persons)
            {
                var items       = personItems.AsEnumerable().Skip(1).Where(i => !(i is System.DBNull));
                var stringItems = items.Select(i => i.ToString());
                var hashes      = stringItems.Select(Farmhash.Sharp.Farmhash.Hash64);
                var minHash     = new MinHash();
                minHash.Add(hashes);
                connection.SetMinHash((long)personItems[0], MinHash.ToByteArray(minHash.MinHashes));
            }

            return(0);
        }