def decode_ulid_base32(encoded):
    """
    Decode a 26-character long base32 string into the original 16 bytes.
    :param encoded: 26-character long string
    :return: 16 bytes
    """
    if len(encoded) != 26:
        raise InvalidULID('base32 ulid is %d characters long, expected 26' % len(encoded))

    if not all(c in _symbols for c in encoded):
        raise InvalidULID('invalid characters in base32 ulid')

    b = [ord(c) for c in encoded]

    if b[0] < 48 or b[0] > 55:
        # See https://github.com/oklog/ulid/issues/9:
        #   Technically, a 26-character Base32 encoded string can contain 130 bits of information,
        #   whereas a ULID must only contain 128 bits.
        #   Therefore, the largest valid ULID encoded in Base32 is 7ZZZZZZZZZZZZZZZZZZZZZZZZZ,
        #   which corresponds to an epoch time of 281474976710655 or 2 ^ 48 - 1.
        raise InvalidULID('base32 ulid is out of range (starts with %s; accepted are 01234567)' % encoded[0])

    tab = _decode_table
    binary = [(c & 0xFF) for c in [
        ((tab[b[0]] << 5) | tab[b[1]]),
        ((tab[b[2]] << 3) | (tab[b[3]] >> 2)),
        ((tab[b[3]] << 6) | (tab[b[4]] << 1) | (tab[b[5]] >> 4)),
        ((tab[b[5]] << 4) | (tab[b[6]] >> 1)),
        ((tab[b[6]] << 7) | (tab[b[7]] << 2) | (tab[b[8]] >> 3)),
        ((tab[b[8]] << 5) | tab[b[9]]),
        ((tab[b[10]] << 3) | (tab[b[11]] >> 2)),
        ((tab[b[11]] << 6) | (tab[b[12]] << 1) | (tab[b[13]] >> 4)),
        ((tab[b[13]] << 4) | (tab[b[14]] >> 1)),
        ((tab[b[14]] << 7) | (tab[b[15]] << 2) | (tab[b[16]] >> 3)),
        ((tab[b[16]] << 5) | tab[b[17]]),
        ((tab[b[18]] << 3) | tab[b[19]] >> 2),
        ((tab[b[19]] << 6) | (tab[b[20]] << 1) | (tab[b[21]] >> 4)),
        ((tab[b[21]] << 4) | (tab[b[22]] >> 1)),
        ((tab[b[22]] << 7) | (tab[b[23]] << 2) | (tab[b[24]] >> 3)),
        ((tab[b[24]] << 5) | tab[b[25]]),
    ]]
    return _to_binary(binary)