Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HMAC/ Hashlib Tutorial Request
#3
(Nov-17-2019, 04:02 PM)Larz60+ Wrote: There's already one in the python documentation: https://docs.python.org/3.8/library/hashlib.html

It's extremely unhelpful. There is no material explaining this to people like me who are new to Python.

For example, both the hmac and hashlib documentation show .hexdigest. So how am I supposed to know which needs to be used?

The documentations also are only for hmac individually and hashlib individually, not how to use hmac.new combined with hashlib.

I'm looking over the documentation of each trying to figure out how this fits together but I really don't think there is explanation there unless people already know how to use hmac and hashlib, especially together.

More example questions that those documentations don't answer:

get.request or post.request? I am very sure get.request is used but have seen some things saying to use post.request.

UTF-8 encoding? Is that used and if so where and for what?

Byte or bytearray? Is that used and if so where and for what? These are two more things I have seen some things say to use in unclear and/or incomplete explanations. Also, byte, b, or bytearray?

Decode key and message as ASCII? Or no? If so how, where, and why/for what purpose?

Is a header for content-type=application/json needed? If so how, where, and why/for what purpose? Bittrex's API documentation only says that a header named apisign is needed that contains the hash. It says nothing about needing json in the headers.

Is base64.base64encode needed and if so how, where, and why/for what purpose?
Reply


Messages In This Thread
HMAC/ Hashlib Tutorial Request - by dn237 - Nov-17-2019, 12:06 PM
RE: HMAC/ Hashlib Tutorial Request - by Larz60+ - Nov-17-2019, 04:02 PM
RE: HMAC/ Hashlib Tutorial Request - by dn237 - Nov-19-2019, 05:53 AM
RE: HMAC/ Hashlib Tutorial Request - by dn237 - Nov-20-2019, 07:56 AM
RE: HMAC/ Hashlib Tutorial Request - by buran - Nov-20-2019, 08:11 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020