How to compress an hexadecimal number into a short string?

if I make it a global variable, It will use 1350 Bytes (65%) from 2048 Bytes.
if I use it in the void loop(), It will use 750 Bytes (36%) from 2048 Bytes.

Where do you think the 600 bytes of free RAM is coming from?