public static function fromString($string) { ParagonIE_Sodium_Core32_Util::
declareScalarType($string, 'string', 1
);
$string =
(string) $string;
if (ParagonIE_Sodium_Core32_Util::
strlen($string) !== 4
) { throw new RangeException( 'String must be 4 bytes; ' . ParagonIE_Sodium_Core32_Util::
strlen($string) . ' given.'
);
} $return =
new ParagonIE_Sodium_Core32_Int32();
$return->limbs
[0
] =
(int) ((ParagonIE_Sodium_Core32_Util::
chrToInt($string[0
]) & 0xff
) << 8
);
$return->limbs
[0
] |= (ParagonIE_Sodium_Core32_Util::
chrToInt($string[1
]) & 0xff
);
$return->limbs
[1
] =
(int) ((ParagonIE_Sodium_Core32_Util::
chrToInt($string[2
]) & 0xff
) << 8
);
$return->limbs
[1
] |= (ParagonIE_Sodium_Core32_Util::
chrToInt($string[3
]) & 0xff
);
return $return;
} /**
* @param string $string
* @return self
* @throws SodiumException
* @throws TypeError
*/