Update pbc.py
This commit is contained in:
parent
3e4585afcb
commit
8df4f4ac90
1 changed files with 4 additions and 3 deletions
7
pbc.py
7
pbc.py
|
@ -11,8 +11,10 @@ from urllib.parse import urlencode
|
|||
import aiohttp
|
||||
import os
|
||||
from dotenv import find_dotenv,load_dotenv
|
||||
from os.path import abspath
|
||||
load_dotenv(find_dotenv(abspath('.env')))
|
||||
from pathlib import Path
|
||||
load_dotenv()
|
||||
env_path = Path('.') / '.env'
|
||||
load_dotenv(dotenv_path=env_path)
|
||||
def hash_hmac(key, code, sha1):
|
||||
hmac_code = hmac.new(key.encode(), code.encode(), sha1)
|
||||
return base64.b64encode(hmac_code.digest()).decode('utf-8')
|
||||
|
@ -23,7 +25,6 @@ def computeMD5hash(my_string):
|
|||
m.update(my_string.encode('gb2312'))
|
||||
return m.hexdigest()
|
||||
|
||||
|
||||
accessKeyId = os.environ.get("accessKeyId")
|
||||
accessKeySecret = os.environ.get("accessKeySecret")
|
||||
print(accessKeyId)
|
||||
|
|
Reference in a new issue