Conio / pybitcointools

Simple, common-sense Bitcoin-themed Python ECC library
Other
25 stars 9 forks source link

Incompatibility with Python 3.5 still present #5

Closed andzsy closed 6 years ago

andzsy commented 6 years ago

Under Python 3.5.3 still getting the ff.

bip32_master_key("xx xx xxxx xxx xxx xxxx xxx") Traceback (most recent call last): File "<pyshell#1>", line 1, in bip32_master_key("scout retire curtain item key render ill require book nuclear mammal train") File "C:\Python35\lib\site-packages\bitcoin-1.0.0_segwit_conio-py3.5.egg\bitcoin\deterministic.py", line 135, in bip32_master_key I = hmac.new(from_string_to_bytes("Bitcoin seed"), seed, hashlib.sha512).digest() File "C:\Python35\lib\hmac.py", line 144, in new return HMAC(key, msg, digestmod) File "C:\Python35\lib\hmac.py", line 84, in init self.update(msg) File "C:\Python35\lib\hmac.py", line 93, in update self.inner.update(msg) TypeError: Unicode-objects must be encoded before hashing

gdassori commented 6 years ago

Hi, this isn't an issue, please use bytes, and not strings, as arguments for those functions. Encode your data.

''.encode() b''