input: Write a python function to generate a Hamming code from a given bit string.
  assert generateHammingCode('1011') == [1, 0, 0, 1, 0, 1, 1]
  assert generateHammingCode('1110') == [1, 1, 1, 1, 0, 1, 0]
  assert generateHammingCode('0001') == [0, 0, 0, 0, 0, 0, 1]
output: def generateHammingCode(bit_string):
      def calcParity(bits, positions):
          parity = 0
          for pos in positions:
              if pos < len(bits):
                  parity ^= bits[pos]
          return parity
  
      n = len(bit_string)
      m = 0
      while (2 ** m) < (n + m + 1):
          m += 1
  
      hamming_code = []
      j = 0
      k = 0
      for i in range(1, n + m + 1):
          if i == 2 ** k:
              hamming_code.append(0)
              k += 1
          else:
              hamming_code.append(int(bit_string[j]))
              j += 1
  
      for i in range(m):
          pos = 2 ** i
          positions = [x for x in range(pos - 1, len(hamming_code), 2 * pos)]
          hamming_code[pos - 1] = calcParity(hamming_code, positions)
  
      overall_parity_positions = list(range(len(hamming_code)))
      overall_parity = calcParity(hamming_code, overall_parity_positions)
      hamming_code.insert(0, overall_parity)
  
      return hamming_code