def ffs(num):
    """Find the lowest order bit that is set

    Args:
        num: the number to search

    Returns:
        The 0-based index of the lowest order bit that is set, or None if no bits are set
    """
    if num == 0:
        return None
    i = 0
    while (num % 2) == 0:
        i += 1
        num = num >> 1
    return i