네이버검색 api (3)인증signaturehelper

Abstract black sand texture creating a dramatic and moody background.

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 파일이 같은 폴더 내 위치해야 함.


게시됨

카테고리

작성자

태그:

댓글

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다