원래 개발자가 아니라 머신러닝 쪽이라.. 어렵네요 ㅠㅠ
파이썬3 샘플 코드 중, xcoin_api_client.py 파일 보면
data = endpoint + chr(0) + str_data + chr(0) + nonce;
utf8_data = data.encode('utf-8');
key = self.api_secret;
utf8_key = key.encode('utf-8');
h = hmac.new(bytes(utf8_key), utf8_data, hashlib.sha512);
hex_output = h.hexdigest();
utf8_hex_output = hex_output.encode('utf-8');
api_sign = base64.b64encode(utf8_hex_output);
utf8_api_sign = api_sign.decode('utf-8');
이렇게 된 부분이 있습니다.
여기서..
1. chr(0)이 하는 역할이 무엇인지.
2. 자꾸 utf-8로 인코딩하고 뭐하고 디코딩하고 하는데 매 코드마다 이걸 왜 자꾸 이렇게 변환하는지..
궁금합니다!