Implemented hashing function for vectors