|
| fillBytes (int $value, int $start, int $count) |
| Fill the bytes field with int. More...
|
|
|
| $bytes = [0, 0, 0, 0, 0, 0, 0, 0] |
|
Definition at line 8 of file Bigint.php.
◆ __construct()
ZipStream\Bigint::__construct |
( |
int |
$value = 0 | ) |
|
Initialize the bytes array.
- Parameters
-
Definition at line 20 of file Bigint.php.
21 {
23 }
fillBytes(int $value, int $start, int $count)
Fill the bytes field with int.
◆ add()
ZipStream\Bigint::add |
( |
Bigint |
$other | ) |
|
Add.
- Parameters
-
- Returns
- Bigint
Definition at line 152 of file Bigint.php.
153 {
155 $overflow = false;
156 for (
$i = 0;
$i < 8;
$i++) {
158 if ($overflow) {
160 $overflow = false;
161 }
163 $overflow = true;
165 }
166 }
167 if ($overflow) {
168 throw new OverflowException;
169 }
171 }
References $i, and $result.
◆ fillBytes()
ZipStream\Bigint::fillBytes |
( |
int |
$value, |
|
|
int |
$start, |
|
|
int |
$count |
|
) |
| |
|
protected |
Fill the bytes field with int.
- Parameters
-
int | $value | |
int | $start | |
int | $count | |
- Returns
- void
Definition at line 33 of file Bigint.php.
33 : void
34 {
35 for (
$i = 0;
$i < $count;
$i++) {
36 $this->bytes[
$start +
$i] =
$i >= PHP_INT_SIZE ? 0 : $value & 0xFF;
37 $value >>= 8;
38 }
39 }
References $i, and $start.
◆ fromLowHigh()
static ZipStream\Bigint::fromLowHigh |
( |
int |
$low, |
|
|
int |
$high |
|
) |
| |
|
static |
◆ getHex64()
ZipStream\Bigint::getHex64 |
( |
| ) |
|
Get hexadecimal.
- Returns
- string
Definition at line 137 of file Bigint.php.
137 : string
138 {
140 for (
$i = 7;
$i >= 0;
$i--) {
141 $result .= sprintf(
'%02X', $this->bytes[
$i]);
142 }
144 }
References $i, and $result.
◆ getHigh32()
ZipStream\Bigint::getHigh32 |
( |
| ) |
|
Get high 32.
- Returns
- int
Definition at line 72 of file Bigint.php.
72 : int
73 {
75 }
getValue(int $end=0, int $length=8)
Get value from bytes array.
◆ getLow32()
ZipStream\Bigint::getLow32 |
( |
| ) |
|
Get low 32.
- Returns
- int
Definition at line 127 of file Bigint.php.
◆ getLowFF()
ZipStream\Bigint::getLowFF |
( |
bool |
$force = false | ) |
|
Get low FF.
- Parameters
-
- Returns
- float
Definition at line 100 of file Bigint.php.
100 : float
101 {
103 return (float)0xFFFFFFFF;
104 }
106 }
isOver32(bool $force=false)
Check if is over 32.
◆ getValue()
ZipStream\Bigint::getValue |
( |
int |
$end = 0 , |
|
|
int |
$length = 8 |
|
) |
| |
Get value from bytes array.
- Parameters
-
- Returns
- int
Definition at line 84 of file Bigint.php.
References $end, $i, and $result.
◆ init()
static ZipStream\Bigint::init |
( |
int |
$value = 0 | ) |
|
|
static |
◆ isOver32()
ZipStream\Bigint::isOver32 |
( |
bool |
$force = false | ) |
|
Check if is over 32.
- Parameters
-
- Returns
- bool
Definition at line 114 of file Bigint.php.
114 : bool
115 {
116
117 return $force ||
118 max(array_slice($this->bytes, 4, 4)) > 0 ||
119 min(array_slice($this->bytes, 0, 4)) === 0xFF;
120 }
◆ $bytes
ZipStream\Bigint::$bytes = [0, 0, 0, 0, 0, 0, 0, 0] |
|
private |
The documentation for this class was generated from the following file:
- libs/composer/vendor/maennchen/zipstream-php/src/Bigint.php