domain: server
language: python
class Task class
This method hash a password with the given method and salt with a string of the given length. The format of the string returned includes the method that was used so that check_password_hash can check the hash.
The method is wrapper over Werkzeug generate_password_hash function: https://werkzeug.palletsprojects.com/en/0.15.x/utils/
def on_apply(item, delta, params, connection):
for d in delta:
if d.password.value:
d.edit();
d.password_hash.value = delta.task.generate_password_hash(d.password.value)
d.password.value = None
d.post();