code: def generate_password_hash(password, digestmod='sha256', salt_length=8):
      
  
      salt = ''.join(random.sample(SALT_CHARS, salt_length))
      signature = create_signature(salt, password, digestmod=digestmod)
      return '$'.join((digestmod, salt, signature))
docs: Hash a password with given method and salt length.