SimHash algorithm implementation