I’m trying to communicate with an API of a Tradingplatform via post requests in Python. Unfortunately, this only works if the request does not have to be signed. At the beginning I just wanted to follow the example of the documentation (BingX API Documentation on GitHub) to get an account balance. The example gave me the impression that this would
Tag: hashlib
Constructing Bech32 addresses
I’m trying to follow the steps here https://en.bitcoin.it/wiki/Bech32 to generate a valid bech32 address. I am getting stuck on the first step: Having a compressed public key (0x02 or 0x03 followed by 32 byte X coordinate): 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 Perform SHA-256 hashing on the public key: 0f715baf5d4c2ed329785cef29e562f73488c8a2bb9dbc5700b361d54b9b0554 Here is one of the things I tried: Note: I’m limited to python 2.7.18 I’m
HMAC SHA-512 hashing function equivalent in node.js
I currently have this snippet in Python – I am trying to replicate it in Node.js, but having difficulty getting the correct hash. Test case: Key: ‘7pgj8Dm6’ Message: ‘TestMessage’ With the python snippet, the hash is With the js snippet, the hash is Am I going wrong with the base64 encoding? Answer In the NodeJS code, the key is first
Outdated hashlib module in a non-current version of Python
I installed a python package that I need, and tried to import it, but there’s a line of code in the package: which returned the error: After a bit of reading, I found that the hashlib module in Python 3.6+ has blake2s, but I’m using Python 3.5.6. Updating my Python version would solve this problem, but I don’t have admin
Generating an MD5 checksum of a file
Is there any simple way of generating (and checking) MD5 checksums of a list of files in Python? (I have a small program I’m working on, and I’d like to confirm the checksums of the files). Answer You can use hashlib.md5() Note that sometimes you won’t be able to fit the whole file in memory. In that case, you’ll have