code: def toBigInt(byteArray):
      
      array = byteArray[::-1]  # reverse array
      out = 0
      for key, value in enumerate(array):
          decoded = struct.unpack("B", bytes([value]))[0]
          out = out | decoded << key * 8
      return out
docs: Convert the byte array to a BigInteger