Updated to generate hash in a more future-proof way