Observe that hex conversion and hex calculation are separate functions and you don't really need to execute a single in an effort to complete the other.
Indeed, programming languages provide functions and libraries https://superseoplus.com/hex-calculator