Added first files for admin and login/signup in admin
This commit is contained in:
parent
e0ed00af8c
commit
d9b62719d7
139 changed files with 18408 additions and 4 deletions
19
paramecio2/libraries/keyutils.py
Normal file
19
paramecio2/libraries/keyutils.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
from hashlib import sha512, sha256
|
||||
from base64 import b64encode
|
||||
from os import urandom
|
||||
|
||||
# Functions for create random strings usando urandom
|
||||
|
||||
def create_key_encrypt(n=10):
|
||||
|
||||
return sha512(urandom(n)).hexdigest()
|
||||
|
||||
def create_key_encrypt_256(n=10):
|
||||
|
||||
return sha256(urandom(n)).hexdigest()
|
||||
|
||||
def create_key(n=10):
|
||||
|
||||
rand_bytes=urandom(n)
|
||||
|
||||
return b64encode(rand_bytes).decode('utf-8')[0:-2]
|
||||
Loading…
Add table
Add a link
Reference in a new issue