Integer
class Integer extends Integer (View source)
Binary Finite Fields
Properties
protected string | $value | Holds the BinaryField's value | |
protected int | $instanceID | Keeps track of current instance | |
static protected string[] | $modulo | Holds the PrimeField's modulo | |
static protected callable[] | $reduce | Holds a pre-generated function to perform modulo reductions |
Methods
Default constructor
Set the modulo for a given instance
Set the modulo for a given instance
Returns the modular inverse of a BinaryFieldInteger
Negate
Returns the modulo
Converts an Integer to a byte string (eg. base-256).
Converts an Integer to a hex string (eg. base-16).
Converts an Integer to a bit string (eg. base-2).
Converts an Integer to a BigInteger
__toString() magic method
__debugInfo() magic method
Details
__construct($instanceID, $num = '')
Default constructor
static
setModulo($instanceID, $modulo)
Set the modulo for a given instance
static
setRecurringModuloFunction($instanceID, callable $function)
Set the modulo for a given instance
bool
equals(Integer $x)
Tests the equality of two numbers.
int
compare(Integer $x)
Compares two numbers.
Integer
modInverse()
Returns the modular inverse of a BinaryFieldInteger
object
negate()
Negate
A negative number can be written as 0-12. With modulos, 0 is the same thing as the modulo so 0-12 is the same thing as modulo-12
static int
getModulo($instanceID)
Returns the modulo
string
toBytes()
Converts an Integer to a byte string (eg. base-256).
string
toHex()
Converts an Integer to a hex string (eg. base-16).
string
toBits()
Converts an Integer to a bit string (eg. base-2).
string
toBigInteger()
Converts an Integer to a BigInteger
__toString()
__toString() magic method
__debugInfo()
__debugInfo() magic method