You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
stacosys/app/helpers/hashing.py

17 lines
304 B
Python

#!/usr/bin/python
# -*- coding: UTF-8 -*-
import hashlib
from conf import config
def salt(value):
string = '%s%s' % (value, config.security['salt'])
dk = hashlib.sha256(string.encode())
return dk.hexdigest()
def md5(value):
dk = hashlib.md5(value.encode())
return dk.hexdigest()