
api 인증방식에 해당
https://github.com/naver/searchad-apidoc/blob/master/python-sample/examples/signaturehelper.py
import hashlib
import hmac
import base64
class Signature:
@staticmethod
def generate(timestamp, method, uri, secret_key):
message = "{}.{}.{}".format(timestamp, method, uri)
hash = hmac.new(bytes(secret_key, "utf-8"), bytes(message, "utf-8"), hashlib.sha256)
hash.hexdigest()
return base64.b64encode(hash.digest())
py 파일이 같은 폴더 내 위치해야 함.
답글 남기기