I am following this link, trying to perform SHA-256 on a given public key.
However, I cannot get the expected result.
I am using the sha256 library in python hashlib
The input is
0450863AD64A87AE8A2FE83C1AF1A8403CB53F53E486D8511DAD8A04887E5B23522CD470243453A299FA9E77237716103ABC11A1DF38855ED6F2EE187E9C582BA6
Mine output is
32511e82d56dcea68eb774094e25bab0f8bdd9bc1eca1ceeda38c7a43aceddce
The expected output on bitcoin.it is
600FFE422B4E00731A59557A5CCA46CC183944191006324A447BDB2D98D4B408
Do I miss anything?
b"hexData"
- for Python 3.x – Wizard Of Ozzie Apr 08 '15 at 15:43import codecs
, thencodecs.encode(codecs.decode("abcdef".encode("utf-8"), "hex")[::-1], "hex").decode()
... It's quite counterintuitive IMO, as I'm so used to Python 2.7 – Wizard Of Ozzie Apr 08 '15 at 15:58