Int

class pyrogue.Int(bitSize)[source]

Model class for signed integers.

Parameters:
  • bitSize (int) – Number of bits being represented.

  • args (Any)

  • kwargs (Any)

Return type:

Any

toBytes(value)[source]

Convert a python int value to a byte array.

Parameters:

value (int) – Python int value to convert.

Returns:

Byte array representation of the value.

Return type:

bytes

fromBytes(ba)[source]

Convert a byte array to a python int value.

Parameters:

ba (bytes) – Byte array to extract value from.

Returns:

Python value.

Return type:

int

fromString(string)[source]

Convert a string to a python int value.

Parameters:

string (str) – String representation of the value.

Returns:

Python value.

Return type:

int

minValue()[source]

Return the minimum signed int (-2**(bitSize-1)).

Return type:

int

maxValue()[source]

Return the maximum signed int (2**(bitSize-1)-1).

Return type:

int