code: def FormatAsHexString(num, width=None, prefix="0x"):
    
    # Strip "0x".
    hex_str = hex(num)[2:]
    # Strip "L" for long values.
    hex_str = hex_str.replace("L", "")
    if width:
      hex_str = hex_str.rjust(width, "0")
    return "%s%s" % (prefix, hex_str)
docs: Takes an int and returns the number formatted as a hex string.