stacosys/app/helper/hashing.py
2018-09-15 15:02:06 +02:00

16 lines
313 B
Python

#!/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()