def slv_to_uint(slv):
    """
    Convert a string of '0' and '1' to an unsigned integer.

    >>> slv_to_uint('001')
    1
    >>> slv_to_uint('1010')
    10
    """
    total = 0
    f = 1
    for ch in reversed(slv):
        if ch not in ('0', '1'):
            total = None
        if total is not None:
            if ch == '1':
                total += f
            f *= 2
    return total
