This commit is contained in:
Yax 2018-09-15 15:02:06 +02:00
parent 3c4a25e5ad
commit 6867e71d7c
11 changed files with 185 additions and 177 deletions

16
app/helper/hashing.py Normal file
View file

@ -0,0 +1,16 @@
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import hashlib
from conf import config
def salt(value):
string = "%s%s" % (value, config.get(config.SECURITY_SALT))
dk = hashlib.sha256(string.encode())
return dk.hexdigest()
def md5(value):
dk = hashlib.md5(value.encode())
return dk.hexdigest()