std: migrate the constraint to the `Hash`

This allows one hasher to be used with multiple types.