13 lines
343 B
Python
13 lines
343 B
Python
|
import hashlib
|
||
|
|
||
|
from dynamic_toekn.token_create import createTempToken
|
||
|
|
||
|
|
||
|
def md5_32_big(s):
|
||
|
result = hashlib.md5(s.encode("utf-8")).hexdigest().upper()
|
||
|
return result
|
||
|
def md5_32_sm(s):
|
||
|
result = hashlib.md5(s.encode("utf-8")).hexdigest().lower()
|
||
|
return result
|
||
|
def random_key(p=""):
|
||
|
return md5_32_sm(p+str(createTempToken()))
|