code: def byte_len(int_type):
      
      length = 0
      while int_type:
          int_type >>= 1
          length += 1
      if length > 0:
          if length % 8 != 0:
              length = int(length / 8) + 1
          else:
              length = int(length / 8)
      return length
docs: Get the number of byte needed to encode the int passed.
  
      :param int_type: the int to be converted
      :return: the number of bits needed to encode the int passed.