def base_to_uint(encoded,
                 base,
                 ord_lookup_table,
                 powers):
  """
  Decodes bytes from the given base into a big integer.

  :param encoded:
      Encoded bytes.
  :param base:
      The base to use.
  :param ord_lookup_table:
      The ordinal lookup table to use.
  :param powers:
      Pre-computed tuple of powers of length ``powers_length``.
  """
  # Convert to big integer.
  #    number = 0
  #    for i, x in enumerate(reversed(encoded)):
  #        number += _lookup[x] * (base**i)
  # Above loop divided into precomputed powers section and computed.
  number = 0
  length = len(encoded)
  powers_length = len(powers)
  for i, char in enumerate(encoded[length:-powers_length - 1:-1]):
    number += ord_lookup_table[char] * powers[i]
  for i in range(powers_length, length):
    char = encoded[length - i - 1]
    number += ord_lookup_table[char] * (base ** i)
  return number