More safe GetHexString() function