function GPBWire::zigZagEncode64
2 calls to GPBWire::zigZagEncode64()
- GPBWire::sint64Size in vendor/
google/ protobuf/ src/ Google/ Protobuf/ Internal/ GPBWire.php - GPBWire::writeSint64 in vendor/
google/ protobuf/ src/ Google/ Protobuf/ Internal/ GPBWire.php
File
-
vendor/
google/ protobuf/ src/ Google/ Protobuf/ Internal/ GPBWire.php, line 117
Class
Namespace
Google\Protobuf\InternalCode
public static function zigZagEncode64($int64) {
if (PHP_INT_SIZE == 4) {
if (bccomp($int64, 0) >= 0) {
return bcmul($int64, 2);
}
else {
return bcsub(bcmul(bcsub(0, $int64), 2), 1);
}
}
else {
return (int) $int64 << 1 ^ (int) $int64 >> 63;
}
}