def mksalt(method=None):
 if (method is None):
  method = methods[0]
 s = ('${}$'.format(method.ident) if method.ident else '')
 s += ''.join((_sr.choice(_saltchars) for char in range(method.salt_chars)))
 return s

def mksalt ( method = None ) : if ( method is None ) : method = methods [ 0 ] s = ( '${}$' . format ( method . ident ) if method . ident else '' ) s += '' . join ( ( _sr . choice ( _saltchars ) for char in range ( method . salt_chars ) ) ) return s
generate a salt for the specified method .