encode the payload only once, and don't mutate the custom hash