MCPcopy Create free account
hub / github.com/ccxt/ccxt / _compressed_encode

Method _compressed_encode

python/ccxt/static_dependencies/ecdsa/keys.py:113–119  ·  view source on GitHub ↗

Encode the point into the compressed form.

(self)

Source from the content-addressed store, hash-verified

111 return x_str + y_str
112
113 def _compressed_encode(self):
114 """Encode the point into the compressed form."""
115 order = self.pubkey.order
116 x_str = number_to_string(self.pubkey.point.x(), order)
117 if self.pubkey.point.y() & 1:
118 return b"\x03" + x_str
119 return b"\x02" + x_str
120
121 def to_string(self, encoding = 'uncompressed'):
122 if encoding == "compressed":

Callers 1

to_stringMethod · 0.95

Calls 3

number_to_stringFunction · 0.70
xMethod · 0.45
yMethod · 0.45

Tested by

no test coverage detected