Added new function for create random hashs

This commit is contained in:
Antonio de la Rosa 2015-12-14 17:31:09 +01:00
parent 9dbfc8daeb
commit 59083cdd3a
2 changed files with 8 additions and 6 deletions

View file

@ -0,0 +1,6 @@
from hashlib import sha512
from os import urandom
def create_key_encrypt(n=10):
return sha512(urandom(n)).hexdigest()

View file

@ -17,16 +17,12 @@ from importlib import import_module, reload
from bottle import redirect from bottle import redirect
from collections import OrderedDict from collections import OrderedDict
from time import time from time import time
from hashlib import sha512 from paramecio.citoplasma.keyutils import create_key_encrypt
from os import urandom, path from os import path
#from citoplasma.login import LoginClass #from citoplasma.login import LoginClass
# Check login # Check login
def create_key_encrypt():
return sha512(urandom(10)).hexdigest()
key_encrypt=create_key_encrypt() key_encrypt=create_key_encrypt()
module_admin=path.dirname(__file__) module_admin=path.dirname(__file__)