chainside / btcpy

A Python3 SegWit-compliant library which provides tools to handle Bitcoin data structures in a simple fashion.
https://www.chainside.net
GNU Lesser General Public License v3.0
270 stars 73 forks source link

PrivateKey generation from entropy #59

Open csyhuang opened 3 years ago

csyhuang commented 3 years ago

Created a @staticmethod in the PrivateKey class called generate that creates a PrivateKey, which is a random hexadecimal string with nbytes bytes, using python's secrets standard module. A corresponding unit test is added.

Please let me know if the pull request meets the requirement, or there are any suggested changes.

Thank you!

31

csyhuang commented 3 years ago

Hi @SimoneBronzini I have made the change you mentioned and pushed the commit. May you have a look and let me know if that's OK? Thanks!