def get_signer_by_version(digest, ver):
    """Returns a new signer object for a digest and version combination.

    Keyword arguments:
    digest -- a callable that may be passed to the initializer of any Signer object in this library.
        The callable must return a hasher object when called with no arguments.
    ver -- the version of the signature. This may be any value convertible to an int.
    """
    if int(ver) == 1:
        return V1Signer(digest)
    elif int(ver) == 2:
        return V2Signer(digest)
    else:
        return None