add toHash() to Typedef