def hash(form): salt = randstring(alphanum, 6) user = form.cleaned_data['user'] password = form.cleaned_data['password'] extra_auth_hash_text = form.cleaned_data['extra_auth_hash_text'] pass_hash = md5(user + password + extra_auth_hash_text).hexdigest() return pass_hash
def hash(form): password = form.cleaned_data['password'] salt = randstring(alphanum, 2) return md5(salt + password).hexdigest() + ':' + salt
def hash(form): salt = randstring(alphanum, 6) password = form.cleaned_data['password'] salt_hash = md5(salt).hexdigest() pass_hash = md5(password).hexdigest() return md5(salt_hash + pass_hash).hexdigest()