added a convenience method to transform an int to a hex (padding with
'0' if necessary)