pads a string to the left with null-bytes or any other given character.

    ..note:: This is used by the :py:func:`xor` function.

    :param s: the string
    :param N: an integer of how much padding should be done
    :returns: the original bytes

def lpad(s, N, char='\0'):
    """pads a string to the left with null-bytes or any other given character.

    ..note:: This is used by the :py:func:`xor` function.

    :param s: the string
    :param N: an integer of how much padding should be done
    :returns: the original bytes
    """
    assert isinstance(char, bytes) and len(char) == 1, 'char should be a string with length 1'
    return s.rjust(N, char)