MCPcopy Index your code
hub / github.com/petertodd/python-bitcoinlib / from_secret_bytes

Method from_secret_bytes

bitcoin/wallet.py:360–365  ·  view source on GitHub ↗

Create a secret key from a 32-byte secret

(cls, secret, compressed=True)

Source from the content-addressed store, hash-verified

358
359 @classmethod
360 def from_secret_bytes(cls, secret, compressed=True):
361 """Create a secret key from a 32-byte secret"""
362 self = cls.from_bytes(secret + (b'\x01' if compressed else b''),
363 bitcoin.params.BASE58_PREFIXES['SECRET_KEY'])
364 self.__init__(None)
365 return self
366
367 def __init__(self, s):
368 if self.nVersion != bitcoin.params.BASE58_PREFIXES['SECRET_KEY']:

Callers 7

testMethod · 0.80
spend-p2wpkh.pyFile · 0.80
publish-text.pyFile · 0.80

Calls 2

__init__Method · 0.95
from_bytesMethod · 0.45

Tested by 1

testMethod · 0.64