Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu.../sodium_c.../src/Core32
File: Int64.php
$x2 = $a2 & $mask;
[500] Fix | Delete
$x3 = $a3 & $mask;
[501] Fix | Delete
[502] Fix | Delete
$ret3 += $x3;
[503] Fix | Delete
$c = $ret3 >> 16;
[504] Fix | Delete
[505] Fix | Delete
$ret2 += $x2 + $c;
[506] Fix | Delete
$c = $ret2 >> 16;
[507] Fix | Delete
[508] Fix | Delete
$ret1 += $x1 + $c;
[509] Fix | Delete
$c = $ret1 >> 16;
[510] Fix | Delete
[511] Fix | Delete
$ret0 += $x0 + $c;
[512] Fix | Delete
[513] Fix | Delete
$ret0 &= 0xffff;
[514] Fix | Delete
$ret1 &= 0xffff;
[515] Fix | Delete
$ret2 &= 0xffff;
[516] Fix | Delete
$ret3 &= 0xffff;
[517] Fix | Delete
[518] Fix | Delete
$a3 = $a3 << 1;
[519] Fix | Delete
$x3 = $a3 >> 16;
[520] Fix | Delete
$a2 = ($a2 << 1) | $x3;
[521] Fix | Delete
$x2 = $a2 >> 16;
[522] Fix | Delete
$a1 = ($a1 << 1) | $x2;
[523] Fix | Delete
$x1 = $a1 >> 16;
[524] Fix | Delete
$a0 = ($a0 << 1) | $x1;
[525] Fix | Delete
$a0 &= 0xffff;
[526] Fix | Delete
$a1 &= 0xffff;
[527] Fix | Delete
$a2 &= 0xffff;
[528] Fix | Delete
$a3 &= 0xffff;
[529] Fix | Delete
[530] Fix | Delete
$x0 = ($b0 & 1) << 16;
[531] Fix | Delete
$x1 = ($b1 & 1) << 16;
[532] Fix | Delete
$x2 = ($b2 & 1) << 16;
[533] Fix | Delete
[534] Fix | Delete
$b0 = ($b0 >> 1);
[535] Fix | Delete
$b1 = (($b1 | $x0) >> 1);
[536] Fix | Delete
$b2 = (($b2 | $x1) >> 1);
[537] Fix | Delete
$b3 = (($b3 | $x2) >> 1);
[538] Fix | Delete
[539] Fix | Delete
$b0 &= 0xffff;
[540] Fix | Delete
$b1 &= 0xffff;
[541] Fix | Delete
$b2 &= 0xffff;
[542] Fix | Delete
$b3 &= 0xffff;
[543] Fix | Delete
[544] Fix | Delete
}
[545] Fix | Delete
$return->limbs[0] = $ret0;
[546] Fix | Delete
$return->limbs[1] = $ret1;
[547] Fix | Delete
$return->limbs[2] = $ret2;
[548] Fix | Delete
$return->limbs[3] = $ret3;
[549] Fix | Delete
[550] Fix | Delete
return $return;
[551] Fix | Delete
}
[552] Fix | Delete
[553] Fix | Delete
/**
[554] Fix | Delete
* OR this 64-bit integer with another.
[555] Fix | Delete
*
[556] Fix | Delete
* @param ParagonIE_Sodium_Core32_Int64 $b
[557] Fix | Delete
* @return ParagonIE_Sodium_Core32_Int64
[558] Fix | Delete
*/
[559] Fix | Delete
public function orInt64(ParagonIE_Sodium_Core32_Int64 $b)
[560] Fix | Delete
{
[561] Fix | Delete
$return = new ParagonIE_Sodium_Core32_Int64();
[562] Fix | Delete
$return->unsignedInt = $this->unsignedInt;
[563] Fix | Delete
$return->limbs = array(
[564] Fix | Delete
(int) ($this->limbs[0] | $b->limbs[0]),
[565] Fix | Delete
(int) ($this->limbs[1] | $b->limbs[1]),
[566] Fix | Delete
(int) ($this->limbs[2] | $b->limbs[2]),
[567] Fix | Delete
(int) ($this->limbs[3] | $b->limbs[3])
[568] Fix | Delete
);
[569] Fix | Delete
return $return;
[570] Fix | Delete
}
[571] Fix | Delete
[572] Fix | Delete
/**
[573] Fix | Delete
* @param int $c
[574] Fix | Delete
* @return ParagonIE_Sodium_Core32_Int64
[575] Fix | Delete
* @throws SodiumException
[576] Fix | Delete
* @throws TypeError
[577] Fix | Delete
* @psalm-suppress MixedArrayAccess
[578] Fix | Delete
*/
[579] Fix | Delete
public function rotateLeft($c = 0)
[580] Fix | Delete
{
[581] Fix | Delete
ParagonIE_Sodium_Core32_Util::declareScalarType($c, 'int', 1);
[582] Fix | Delete
/** @var int $c */
[583] Fix | Delete
$c = (int) $c;
[584] Fix | Delete
[585] Fix | Delete
$return = new ParagonIE_Sodium_Core32_Int64();
[586] Fix | Delete
$return->unsignedInt = $this->unsignedInt;
[587] Fix | Delete
$c &= 63;
[588] Fix | Delete
if ($c === 0) {
[589] Fix | Delete
// NOP, but we want a copy.
[590] Fix | Delete
$return->limbs = $this->limbs;
[591] Fix | Delete
} else {
[592] Fix | Delete
/** @var array<int, int> $limbs */
[593] Fix | Delete
$limbs =& $return->limbs;
[594] Fix | Delete
[595] Fix | Delete
/** @var array<int, int> $myLimbs */
[596] Fix | Delete
$myLimbs =& $this->limbs;
[597] Fix | Delete
[598] Fix | Delete
/** @var int $idx_shift */
[599] Fix | Delete
$idx_shift = ($c >> 4) & 3;
[600] Fix | Delete
/** @var int $sub_shift */
[601] Fix | Delete
$sub_shift = $c & 15;
[602] Fix | Delete
[603] Fix | Delete
for ($i = 3; $i >= 0; --$i) {
[604] Fix | Delete
/** @var int $j */
[605] Fix | Delete
$j = ($i + $idx_shift) & 3;
[606] Fix | Delete
/** @var int $k */
[607] Fix | Delete
$k = ($i + $idx_shift + 1) & 3;
[608] Fix | Delete
$limbs[$i] = (int) (
[609] Fix | Delete
(
[610] Fix | Delete
((int) ($myLimbs[$j]) << $sub_shift)
[611] Fix | Delete
|
[612] Fix | Delete
((int) ($myLimbs[$k]) >> (16 - $sub_shift))
[613] Fix | Delete
) & 0xffff
[614] Fix | Delete
);
[615] Fix | Delete
}
[616] Fix | Delete
}
[617] Fix | Delete
return $return;
[618] Fix | Delete
}
[619] Fix | Delete
[620] Fix | Delete
/**
[621] Fix | Delete
* Rotate to the right
[622] Fix | Delete
*
[623] Fix | Delete
* @param int $c
[624] Fix | Delete
* @return ParagonIE_Sodium_Core32_Int64
[625] Fix | Delete
* @throws SodiumException
[626] Fix | Delete
* @throws TypeError
[627] Fix | Delete
* @psalm-suppress MixedArrayAccess
[628] Fix | Delete
*/
[629] Fix | Delete
public function rotateRight($c = 0)
[630] Fix | Delete
{
[631] Fix | Delete
ParagonIE_Sodium_Core32_Util::declareScalarType($c, 'int', 1);
[632] Fix | Delete
/** @var int $c */
[633] Fix | Delete
$c = (int) $c;
[634] Fix | Delete
[635] Fix | Delete
/** @var ParagonIE_Sodium_Core32_Int64 $return */
[636] Fix | Delete
$return = new ParagonIE_Sodium_Core32_Int64();
[637] Fix | Delete
$return->unsignedInt = $this->unsignedInt;
[638] Fix | Delete
$c &= 63;
[639] Fix | Delete
/** @var int $c */
[640] Fix | Delete
if ($c === 0) {
[641] Fix | Delete
// NOP, but we want a copy.
[642] Fix | Delete
$return->limbs = $this->limbs;
[643] Fix | Delete
} else {
[644] Fix | Delete
/** @var array<int, int> $limbs */
[645] Fix | Delete
$limbs =& $return->limbs;
[646] Fix | Delete
[647] Fix | Delete
/** @var array<int, int> $myLimbs */
[648] Fix | Delete
$myLimbs =& $this->limbs;
[649] Fix | Delete
[650] Fix | Delete
/** @var int $idx_shift */
[651] Fix | Delete
$idx_shift = ($c >> 4) & 3;
[652] Fix | Delete
/** @var int $sub_shift */
[653] Fix | Delete
$sub_shift = $c & 15;
[654] Fix | Delete
[655] Fix | Delete
for ($i = 3; $i >= 0; --$i) {
[656] Fix | Delete
/** @var int $j */
[657] Fix | Delete
$j = ($i - $idx_shift) & 3;
[658] Fix | Delete
/** @var int $k */
[659] Fix | Delete
$k = ($i - $idx_shift - 1) & 3;
[660] Fix | Delete
$limbs[$i] = (int) (
[661] Fix | Delete
(
[662] Fix | Delete
((int) ($myLimbs[$j]) >> (int) ($sub_shift))
[663] Fix | Delete
|
[664] Fix | Delete
((int) ($myLimbs[$k]) << (16 - (int) ($sub_shift)))
[665] Fix | Delete
) & 0xffff
[666] Fix | Delete
);
[667] Fix | Delete
}
[668] Fix | Delete
}
[669] Fix | Delete
return $return;
[670] Fix | Delete
}
[671] Fix | Delete
/**
[672] Fix | Delete
* @param int $c
[673] Fix | Delete
* @return ParagonIE_Sodium_Core32_Int64
[674] Fix | Delete
* @throws SodiumException
[675] Fix | Delete
* @throws TypeError
[676] Fix | Delete
*/
[677] Fix | Delete
public function shiftLeft($c = 0)
[678] Fix | Delete
{
[679] Fix | Delete
ParagonIE_Sodium_Core32_Util::declareScalarType($c, 'int', 1);
[680] Fix | Delete
/** @var int $c */
[681] Fix | Delete
$c = (int) $c;
[682] Fix | Delete
[683] Fix | Delete
$return = new ParagonIE_Sodium_Core32_Int64();
[684] Fix | Delete
$return->unsignedInt = $this->unsignedInt;
[685] Fix | Delete
$c &= 63;
[686] Fix | Delete
[687] Fix | Delete
if ($c >= 16) {
[688] Fix | Delete
if ($c >= 48) {
[689] Fix | Delete
$return->limbs = array(
[690] Fix | Delete
$this->limbs[3], 0, 0, 0
[691] Fix | Delete
);
[692] Fix | Delete
} elseif ($c >= 32) {
[693] Fix | Delete
$return->limbs = array(
[694] Fix | Delete
$this->limbs[2], $this->limbs[3], 0, 0
[695] Fix | Delete
);
[696] Fix | Delete
} else {
[697] Fix | Delete
$return->limbs = array(
[698] Fix | Delete
$this->limbs[1], $this->limbs[2], $this->limbs[3], 0
[699] Fix | Delete
);
[700] Fix | Delete
}
[701] Fix | Delete
return $return->shiftLeft($c & 15);
[702] Fix | Delete
}
[703] Fix | Delete
if ($c === 0) {
[704] Fix | Delete
$return->limbs = $this->limbs;
[705] Fix | Delete
} elseif ($c < 0) {
[706] Fix | Delete
/** @var int $c */
[707] Fix | Delete
return $this->shiftRight(-$c);
[708] Fix | Delete
} else {
[709] Fix | Delete
if (!is_int($c)) {
[710] Fix | Delete
throw new TypeError();
[711] Fix | Delete
}
[712] Fix | Delete
/** @var int $carry */
[713] Fix | Delete
$carry = 0;
[714] Fix | Delete
for ($i = 3; $i >= 0; --$i) {
[715] Fix | Delete
/** @var int $tmp */
[716] Fix | Delete
$tmp = ($this->limbs[$i] << $c) | ($carry & 0xffff);
[717] Fix | Delete
$return->limbs[$i] = (int) ($tmp & 0xffff);
[718] Fix | Delete
/** @var int $carry */
[719] Fix | Delete
$carry = $tmp >> 16;
[720] Fix | Delete
}
[721] Fix | Delete
}
[722] Fix | Delete
return $return;
[723] Fix | Delete
}
[724] Fix | Delete
[725] Fix | Delete
/**
[726] Fix | Delete
* @param int $c
[727] Fix | Delete
* @return ParagonIE_Sodium_Core32_Int64
[728] Fix | Delete
* @throws SodiumException
[729] Fix | Delete
* @throws TypeError
[730] Fix | Delete
*/
[731] Fix | Delete
public function shiftRight($c = 0)
[732] Fix | Delete
{
[733] Fix | Delete
ParagonIE_Sodium_Core32_Util::declareScalarType($c, 'int', 1);
[734] Fix | Delete
$c = (int) $c;
[735] Fix | Delete
/** @var int $c */
[736] Fix | Delete
$return = new ParagonIE_Sodium_Core32_Int64();
[737] Fix | Delete
$return->unsignedInt = $this->unsignedInt;
[738] Fix | Delete
$c &= 63;
[739] Fix | Delete
[740] Fix | Delete
$negative = -(($this->limbs[0] >> 15) & 1);
[741] Fix | Delete
if ($c >= 16) {
[742] Fix | Delete
if ($c >= 48) {
[743] Fix | Delete
$return->limbs = array(
[744] Fix | Delete
(int) ($negative & 0xffff),
[745] Fix | Delete
(int) ($negative & 0xffff),
[746] Fix | Delete
(int) ($negative & 0xffff),
[747] Fix | Delete
(int) $this->limbs[0]
[748] Fix | Delete
);
[749] Fix | Delete
} elseif ($c >= 32) {
[750] Fix | Delete
$return->limbs = array(
[751] Fix | Delete
(int) ($negative & 0xffff),
[752] Fix | Delete
(int) ($negative & 0xffff),
[753] Fix | Delete
(int) $this->limbs[0],
[754] Fix | Delete
(int) $this->limbs[1]
[755] Fix | Delete
);
[756] Fix | Delete
} else {
[757] Fix | Delete
$return->limbs = array(
[758] Fix | Delete
(int) ($negative & 0xffff),
[759] Fix | Delete
(int) $this->limbs[0],
[760] Fix | Delete
(int) $this->limbs[1],
[761] Fix | Delete
(int) $this->limbs[2]
[762] Fix | Delete
);
[763] Fix | Delete
}
[764] Fix | Delete
return $return->shiftRight($c & 15);
[765] Fix | Delete
}
[766] Fix | Delete
[767] Fix | Delete
if ($c === 0) {
[768] Fix | Delete
$return->limbs = $this->limbs;
[769] Fix | Delete
} elseif ($c < 0) {
[770] Fix | Delete
return $this->shiftLeft(-$c);
[771] Fix | Delete
} else {
[772] Fix | Delete
if (!is_int($c)) {
[773] Fix | Delete
throw new TypeError();
[774] Fix | Delete
}
[775] Fix | Delete
/** @var int $carryRight */
[776] Fix | Delete
$carryRight = ($negative & 0xffff);
[777] Fix | Delete
$mask = (int) (((1 << ($c + 1)) - 1) & 0xffff);
[778] Fix | Delete
for ($i = 0; $i < 4; ++$i) {
[779] Fix | Delete
$return->limbs[$i] = (int) (
[780] Fix | Delete
(($this->limbs[$i] >> $c) | ($carryRight << (16 - $c))) & 0xffff
[781] Fix | Delete
);
[782] Fix | Delete
$carryRight = (int) ($this->limbs[$i] & $mask);
[783] Fix | Delete
}
[784] Fix | Delete
}
[785] Fix | Delete
return $return;
[786] Fix | Delete
}
[787] Fix | Delete
[788] Fix | Delete
[789] Fix | Delete
/**
[790] Fix | Delete
* Subtract a normal integer from an int64 object.
[791] Fix | Delete
*
[792] Fix | Delete
* @param int $int
[793] Fix | Delete
* @return ParagonIE_Sodium_Core32_Int64
[794] Fix | Delete
* @throws SodiumException
[795] Fix | Delete
* @throws TypeError
[796] Fix | Delete
*/
[797] Fix | Delete
public function subInt($int)
[798] Fix | Delete
{
[799] Fix | Delete
ParagonIE_Sodium_Core32_Util::declareScalarType($int, 'int', 1);
[800] Fix | Delete
$int = (int) $int;
[801] Fix | Delete
[802] Fix | Delete
$return = new ParagonIE_Sodium_Core32_Int64();
[803] Fix | Delete
$return->unsignedInt = $this->unsignedInt;
[804] Fix | Delete
[805] Fix | Delete
/** @var int $carry */
[806] Fix | Delete
$carry = 0;
[807] Fix | Delete
for ($i = 3; $i >= 0; --$i) {
[808] Fix | Delete
/** @var int $tmp */
[809] Fix | Delete
$tmp = $this->limbs[$i] - (($int >> 16) & 0xffff) + $carry;
[810] Fix | Delete
/** @var int $carry */
[811] Fix | Delete
$carry = $tmp >> 16;
[812] Fix | Delete
$return->limbs[$i] = (int) ($tmp & 0xffff);
[813] Fix | Delete
}
[814] Fix | Delete
return $return;
[815] Fix | Delete
}
[816] Fix | Delete
[817] Fix | Delete
/**
[818] Fix | Delete
* The difference between two Int64 objects.
[819] Fix | Delete
*
[820] Fix | Delete
* @param ParagonIE_Sodium_Core32_Int64 $b
[821] Fix | Delete
* @return ParagonIE_Sodium_Core32_Int64
[822] Fix | Delete
*/
[823] Fix | Delete
public function subInt64(ParagonIE_Sodium_Core32_Int64 $b)
[824] Fix | Delete
{
[825] Fix | Delete
$return = new ParagonIE_Sodium_Core32_Int64();
[826] Fix | Delete
$return->unsignedInt = $this->unsignedInt;
[827] Fix | Delete
/** @var int $carry */
[828] Fix | Delete
$carry = 0;
[829] Fix | Delete
for ($i = 3; $i >= 0; --$i) {
[830] Fix | Delete
/** @var int $tmp */
[831] Fix | Delete
$tmp = $this->limbs[$i] - $b->limbs[$i] + $carry;
[832] Fix | Delete
/** @var int $carry */
[833] Fix | Delete
$carry = ($tmp >> 16);
[834] Fix | Delete
$return->limbs[$i] = (int) ($tmp & 0xffff);
[835] Fix | Delete
}
[836] Fix | Delete
return $return;
[837] Fix | Delete
}
[838] Fix | Delete
[839] Fix | Delete
/**
[840] Fix | Delete
* XOR this 64-bit integer with another.
[841] Fix | Delete
*
[842] Fix | Delete
* @param ParagonIE_Sodium_Core32_Int64 $b
[843] Fix | Delete
* @return ParagonIE_Sodium_Core32_Int64
[844] Fix | Delete
*/
[845] Fix | Delete
public function xorInt64(ParagonIE_Sodium_Core32_Int64 $b)
[846] Fix | Delete
{
[847] Fix | Delete
$return = new ParagonIE_Sodium_Core32_Int64();
[848] Fix | Delete
$return->unsignedInt = $this->unsignedInt;
[849] Fix | Delete
$return->limbs = array(
[850] Fix | Delete
(int) ($this->limbs[0] ^ $b->limbs[0]),
[851] Fix | Delete
(int) ($this->limbs[1] ^ $b->limbs[1]),
[852] Fix | Delete
(int) ($this->limbs[2] ^ $b->limbs[2]),
[853] Fix | Delete
(int) ($this->limbs[3] ^ $b->limbs[3])
[854] Fix | Delete
);
[855] Fix | Delete
return $return;
[856] Fix | Delete
}
[857] Fix | Delete
[858] Fix | Delete
/**
[859] Fix | Delete
* @param int $low
[860] Fix | Delete
* @param int $high
[861] Fix | Delete
* @return self
[862] Fix | Delete
* @throws SodiumException
[863] Fix | Delete
* @throws TypeError
[864] Fix | Delete
*/
[865] Fix | Delete
public static function fromInts($low, $high)
[866] Fix | Delete
{
[867] Fix | Delete
ParagonIE_Sodium_Core32_Util::declareScalarType($low, 'int', 1);
[868] Fix | Delete
ParagonIE_Sodium_Core32_Util::declareScalarType($high, 'int', 2);
[869] Fix | Delete
[870] Fix | Delete
$high = (int) $high;
[871] Fix | Delete
$low = (int) $low;
[872] Fix | Delete
return new ParagonIE_Sodium_Core32_Int64(
[873] Fix | Delete
array(
[874] Fix | Delete
(int) (($high >> 16) & 0xffff),
[875] Fix | Delete
(int) ($high & 0xffff),
[876] Fix | Delete
(int) (($low >> 16) & 0xffff),
[877] Fix | Delete
(int) ($low & 0xffff)
[878] Fix | Delete
)
[879] Fix | Delete
);
[880] Fix | Delete
}
[881] Fix | Delete
[882] Fix | Delete
/**
[883] Fix | Delete
* @param int $low
[884] Fix | Delete
* @return self
[885] Fix | Delete
* @throws SodiumException
[886] Fix | Delete
* @throws TypeError
[887] Fix | Delete
*/
[888] Fix | Delete
public static function fromInt($low)
[889] Fix | Delete
{
[890] Fix | Delete
ParagonIE_Sodium_Core32_Util::declareScalarType($low, 'int', 1);
[891] Fix | Delete
$low = (int) $low;
[892] Fix | Delete
[893] Fix | Delete
return new ParagonIE_Sodium_Core32_Int64(
[894] Fix | Delete
array(
[895] Fix | Delete
0,
[896] Fix | Delete
0,
[897] Fix | Delete
(int) (($low >> 16) & 0xffff),
[898] Fix | Delete
(int) ($low & 0xffff)
[899] Fix | Delete
)
[900] Fix | Delete
);
[901] Fix | Delete
}
[902] Fix | Delete
[903] Fix | Delete
/**
[904] Fix | Delete
* @return int
[905] Fix | Delete
*/
[906] Fix | Delete
public function toInt()
[907] Fix | Delete
{
[908] Fix | Delete
return (int) (
[909] Fix | Delete
(($this->limbs[2] & 0xffff) << 16)
[910] Fix | Delete
|
[911] Fix | Delete
($this->limbs[3] & 0xffff)
[912] Fix | Delete
);
[913] Fix | Delete
}
[914] Fix | Delete
[915] Fix | Delete
/**
[916] Fix | Delete
* @param string $string
[917] Fix | Delete
* @return self
[918] Fix | Delete
* @throws SodiumException
[919] Fix | Delete
* @throws TypeError
[920] Fix | Delete
*/
[921] Fix | Delete
public static function fromString($string)
[922] Fix | Delete
{
[923] Fix | Delete
ParagonIE_Sodium_Core32_Util::declareScalarType($string, 'string', 1);
[924] Fix | Delete
$string = (string) $string;
[925] Fix | Delete
if (ParagonIE_Sodium_Core32_Util::strlen($string) !== 8) {
[926] Fix | Delete
throw new RangeException(
[927] Fix | Delete
'String must be 8 bytes; ' . ParagonIE_Sodium_Core32_Util::strlen($string) . ' given.'
[928] Fix | Delete
);
[929] Fix | Delete
}
[930] Fix | Delete
$return = new ParagonIE_Sodium_Core32_Int64();
[931] Fix | Delete
[932] Fix | Delete
$return->limbs[0] = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[0]) & 0xff) << 8);
[933] Fix | Delete
$return->limbs[0] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[1]) & 0xff);
[934] Fix | Delete
$return->limbs[1] = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[2]) & 0xff) << 8);
[935] Fix | Delete
$return->limbs[1] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[3]) & 0xff);
[936] Fix | Delete
$return->limbs[2] = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[4]) & 0xff) << 8);
[937] Fix | Delete
$return->limbs[2] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[5]) & 0xff);
[938] Fix | Delete
$return->limbs[3] = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[6]) & 0xff) << 8);
[939] Fix | Delete
$return->limbs[3] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[7]) & 0xff);
[940] Fix | Delete
return $return;
[941] Fix | Delete
}
[942] Fix | Delete
[943] Fix | Delete
/**
[944] Fix | Delete
* @param string $string
[945] Fix | Delete
* @return self
[946] Fix | Delete
* @throws SodiumException
[947] Fix | Delete
* @throws TypeError
[948] Fix | Delete
*/
[949] Fix | Delete
public static function fromReverseString($string)
[950] Fix | Delete
{
[951] Fix | Delete
ParagonIE_Sodium_Core32_Util::declareScalarType($string, 'string', 1);
[952] Fix | Delete
$string = (string) $string;
[953] Fix | Delete
if (ParagonIE_Sodium_Core32_Util::strlen($string) !== 8) {
[954] Fix | Delete
throw new RangeException(
[955] Fix | Delete
'String must be 8 bytes; ' . ParagonIE_Sodium_Core32_Util::strlen($string) . ' given.'
[956] Fix | Delete
);
[957] Fix | Delete
}
[958] Fix | Delete
$return = new ParagonIE_Sodium_Core32_Int64();
[959] Fix | Delete
[960] Fix | Delete
$return->limbs[0] = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[7]) & 0xff) << 8);
[961] Fix | Delete
$return->limbs[0] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[6]) & 0xff);
[962] Fix | Delete
$return->limbs[1] = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[5]) & 0xff) << 8);
[963] Fix | Delete
$return->limbs[1] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[4]) & 0xff);
[964] Fix | Delete
$return->limbs[2] = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[3]) & 0xff) << 8);
[965] Fix | Delete
$return->limbs[2] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[2]) & 0xff);
[966] Fix | Delete
$return->limbs[3] = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[1]) & 0xff) << 8);
[967] Fix | Delete
$return->limbs[3] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[0]) & 0xff);
[968] Fix | Delete
return $return;
[969] Fix | Delete
}
[970] Fix | Delete
[971] Fix | Delete
/**
[972] Fix | Delete
* @return array<int, int>
[973] Fix | Delete
*/
[974] Fix | Delete
public function toArray()
[975] Fix | Delete
{
[976] Fix | Delete
return array(
[977] Fix | Delete
(int) ((($this->limbs[0] & 0xffff) << 16) | ($this->limbs[1] & 0xffff)),
[978] Fix | Delete
(int) ((($this->limbs[2] & 0xffff) << 16) | ($this->limbs[3] & 0xffff))
[979] Fix | Delete
);
[980] Fix | Delete
}
[981] Fix | Delete
[982] Fix | Delete
/**
[983] Fix | Delete
* @return ParagonIE_Sodium_Core32_Int32
[984] Fix | Delete
*/
[985] Fix | Delete
public function toInt32()
[986] Fix | Delete
{
[987] Fix | Delete
$return = new ParagonIE_Sodium_Core32_Int32();
[988] Fix | Delete
$return->limbs[0] = (int) ($this->limbs[2]);
[989] Fix | Delete
$return->limbs[1] = (int) ($this->limbs[3]);
[990] Fix | Delete
$return->unsignedInt = $this->unsignedInt;
[991] Fix | Delete
$return->overflow = (int) (ParagonIE_Sodium_Core32_Util::abs($this->limbs[1], 16) & 0xffff);
[992] Fix | Delete
return $return;
[993] Fix | Delete
}
[994] Fix | Delete
[995] Fix | Delete
/**
[996] Fix | Delete
* @return ParagonIE_Sodium_Core32_Int64
[997] Fix | Delete
*/
[998] Fix | Delete
public function toInt64()
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function