def integer_bit_length(number):
    """
  Number of bits needed to represent a integer excluding any prefix
  0 bits.

  :param number:
      Integer value. If num is 0, returns 0. Only the absolute value of the
      number is considered. Therefore, signed integers will be abs(num)
      before the number's bit length is determined.
  :returns:
      Returns the number of bits in the integer.
  """
    if number == 0:
        return 0
    if number < 0:
        number = -number
    _ = number & 1
    hex_num = '%x' % number
    return (len(hex_num) - 1) * 4 + {'0': 0, '1': 1, '2': 2, '3': 2, '4': 3,
        '5': 3, '6': 3, '7': 3, '8': 4, '9': 4, 'a': 4, 'b': 4, 'c': 4, 'd':
        4, 'e': 4, 'f': 4}[hex_num[0]]
