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

Method from_bytes

bitcoin/base58.py:110–117  ·  view source on GitHub ↗

Instantiate from data and nVersion

(cls, data, nVersion)

Source from the content-addressed store, hash-verified

108
109 @classmethod
110 def from_bytes(cls, data, nVersion):
111 """Instantiate from data and nVersion"""
112 if not (0 <= nVersion <= 255):
113 raise ValueError('nVersion must be in range 0 to 255 inclusive; got %d' % nVersion)
114 self = bytes.__new__(cls, data)
115 self.nVersion = nVersion
116
117 return self
118
119 def to_bytes(self):
120 """Convert to bytes instance

Callers 1

__new__Method · 0.45

Calls 1

__new__Method · 0.45

Tested by

no test coverage detected