Implement tuple hashing