ParagonIE_Sodium_Core32_Int32

Class ParagonIE_Sodium_Core32_Int32

Encapsulates a 32-bit integer.

These are immutable. It always returns a new instance.

package

Default

Methods

ParagonIE_Sodium_Core32_Int32 constructor.

__construct(array $array = array(0, 0),boolean $unsignedInt = false)

Arguments

$array

array

$unsignedInt

boolean

__toString

__toString(): string

Response

string

Adds a normal integer to an int32 object

addInt(integer $int): \ParagonIE_Sodium_Core32_Int32
Throws
\SodiumException
\TypeError

Arguments

$int

integer

Response

\ParagonIE_Sodium_Core32_Int32

Adds two int32 objects

addInt32(\ParagonIE_Sodium_Core32_Int32 $addend): \ParagonIE_Sodium_Core32_Int32

compareInt

compareInt(integer $b): integer

Arguments

$b

integer

Response

integer

fromInt

fromInt(integer $signed): self
static
Throws
\SodiumException
\TypeError

Arguments

$signed

integer

Response

self

fromReverseString

fromReverseString(string $string): self
static
Throws
\SodiumException
\TypeError

Arguments

$string

string

Response

self

fromString

fromString(string $string): self
static
Throws
\SodiumException
\TypeError

Arguments

$string

string

Response

self

isGreaterThan

isGreaterThan(integer $b): boolean

Arguments

$b

integer

Response

boolean

isLessThanInt

isLessThanInt(integer $b): boolean

Arguments

$b

integer

Response

boolean

mask

mask(integer $m): \ParagonIE_Sodium_Core32_Int32

Arguments

$m

integer

Response

\ParagonIE_Sodium_Core32_Int32

mulInt

mulInt(integer $int,integer $size): \ParagonIE_Sodium_Core32_Int32
Throws
\SodiumException
\TypeError

Arguments

$int

integer

$size

integer

Response

\ParagonIE_Sodium_Core32_Int32

mulInt32

mulInt32(\ParagonIE_Sodium_Core32_Int32 $int,integer $size): \ParagonIE_Sodium_Core32_Int32
Throws
\SodiumException
\TypeError

Arguments

$size

integer

Response

\ParagonIE_Sodium_Core32_Int32

mulInt32Fast

mulInt32Fast(\ParagonIE_Sodium_Core32_Int32 $right): \ParagonIE_Sodium_Core32_Int32

mulIntFast

mulIntFast(integer $int): \ParagonIE_Sodium_Core32_Int32

Arguments

$int

integer

Response

\ParagonIE_Sodium_Core32_Int32

multiplyLong

multiplyLong(array $a,array $b,integer $baseLog2 = 16): \array<int,

Arguments

$a

array

$b

array

$baseLog2

integer

Response

\array

int>

OR this 32-bit integer with another.

orInt32(\ParagonIE_Sodium_Core32_Int32 $b): \ParagonIE_Sodium_Core32_Int32

rotateLeft

rotateLeft(integer $c): \ParagonIE_Sodium_Core32_Int32
psalm-suppress

MixedArrayAccess

Throws
\SodiumException
\TypeError

Arguments

$c

integer

Response

\ParagonIE_Sodium_Core32_Int32

Rotate to the right

rotateRight(integer $c): \ParagonIE_Sodium_Core32_Int32
psalm-suppress

MixedArrayAccess

Throws
\SodiumException
\TypeError

Arguments

$c

integer

Response

\ParagonIE_Sodium_Core32_Int32

setUnsignedInt

setUnsignedInt(boolean $bool = false): self

Arguments

$bool

boolean

Response

self

shiftLeft

shiftLeft(integer $c): \ParagonIE_Sodium_Core32_Int32
Throws
\SodiumException
\TypeError

Arguments

$c

integer

Response

\ParagonIE_Sodium_Core32_Int32

shiftRight

shiftRight(integer $c): \ParagonIE_Sodium_Core32_Int32
psalm-suppress

MixedAssignment

MixedOperand

Throws
\SodiumException
\TypeError

Arguments

$c

integer

Response

\ParagonIE_Sodium_Core32_Int32

Subtract a normal integer from an int32 object.

subInt(integer $int): \ParagonIE_Sodium_Core32_Int32
Throws
\SodiumException
\TypeError

Arguments

$int

integer

Response

\ParagonIE_Sodium_Core32_Int32

Subtract two int32 objects from each other

subInt32(\ParagonIE_Sodium_Core32_Int32 $b): \ParagonIE_Sodium_Core32_Int32

toArray

toArray(): \array<int,

Response

\array

int>

toInt

toInt(): integer

Response

integer

toInt32

toInt32(): \ParagonIE_Sodium_Core32_Int32

toInt64

toInt64(): \ParagonIE_Sodium_Core32_Int64

toReverseString

toReverseString(): string
Throws
\TypeError

Response

string

toString

toString(): string
Throws
\TypeError

Response

string

XOR this 32-bit integer with another.

xorInt32(\ParagonIE_Sodium_Core32_Int32 $b): \ParagonIE_Sodium_Core32_Int32

Properties

int> - two 16-bit integers 0 is the higher 16 bits 1 is the lower 16 bits

limbs :\array<int,
var

int> - two 16-bit integers

0 is the higher 16 bits 1 is the lower 16 bits

Type(s)

\array

overflow

overflow :integer
var

Type(s)

integer

unsignedInt

unsignedInt :boolean
var

Type(s)

boolean