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

Method ToInteger

python/ccxt/static_dependencies/bip/utils/misc/bytes.py:117–131  ·  view source on GitHub ↗

Convert the specified bytes to integer. Args: data_bytes (bytes) : Data bytes endianness ("big" or "little", optional): Endianness (default: big) signed (bool, optional) : True if signed, false otherwise (defa

(data_bytes: bytes,
                  endianness: Literal["little", "big"] = "big",
                  signed: bool = False)

Source from the content-addressed store, hash-verified

115
116 @staticmethod
117 def ToInteger(data_bytes: bytes,
118 endianness: Literal["little", "big"] = "big",
119 signed: bool = False) -> int:
120 """
121 Convert the specified bytes to integer.
122
123 Args:
124 data_bytes (bytes) : Data bytes
125 endianness ("big" or "little", optional): Endianness (default: big)
126 signed (bool, optional) : True if signed, false otherwise (default: false)
127
128 Returns:
129 int: Integer representation
130 """
131 return int.from_bytes(data_bytes, byteorder=endianness, signed=signed)
132
133 @staticmethod
134 def FromBinaryStr(data: Union[bytes, str],

Callers 11

FromBytesMethod · 0.80
FromBytesMethod · 0.80
ToBinaryStrMethod · 0.80
ToIntMethod · 0.80
FromBytesMethod · 0.80
_NewPublicKeyPointMethod · 0.80
CkdPrivMethod · 0.80
CkdPubMethod · 0.80
EncodeMethod · 0.80

Calls 1

from_bytesMethod · 0.45

Tested by

no test coverage detected