Updated hash function so it doesn't take a length.