def gen_salt(length):
 if (length <= 0):
  raise ValueError('requested salt of length <= 0')
 return ''.join((_sys_rng.choice(SALT_CHARS) for _ in xrange(length)))

def gen_salt ( length ) : if ( length <= 0 ) : raise ValueError ( 'requested salt of length <= 0' ) return '' . join ( ( _sys_rng . choice ( SALT_CHARS ) for _ in xrange ( length ) ) )
generate a random string of salt_chars with specified length .