CREATE FUNCTION "user_get_ha1" ("user_" text, "domain_" text, "password_" text) RETURNS text LANGUAGE plpython3u AS '
import hashlib
string = "{}:{}:{}".format(user_, domain_, password_)
return hashlib.md5(string.encode(''utf-8'')).hexdigest()
';
CREATE FUNCTION "user_get_ha1b" ("user_" text, "domain_" text, "password_" text) RETURNS text LANGUAGE plpython3u AS '
import hashlib
string = "{}@{}:{}:{}".format(user_, domain_, domain_, password_)
return hashlib.md5(string.encode(''utf-8'')).hexdigest()
';