Utils function for hashing transactions