Generate a salt for the specified method.
    If not specified, the strongest available method will be used.

def mksalt(method=None, rounds=None):
    """Generate a salt for the specified method.
    If not specified, the strongest available method will be used.
    """
    if method is None:
        method = methods[0]
    salt = ['${0}$'.format(method.ident) if method.ident else '']
    if rounds:
        salt.append('rounds={0:d}$'.format(rounds))
    salt.append(''.join(_sr.choice(_BASE64_CHARACTERS) for char in range(method.salt_chars)))
    return ''.join(salt)