Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. GPBWire.php

function GPBWire::zigZagDecode64

1 call to GPBWire::zigZagDecode64()
GPBWire::readSint64 in vendor/google/protobuf/src/Google/Protobuf/Internal/GPBWire.php

File

vendor/google/protobuf/src/Google/Protobuf/Internal/GPBWire.php, line 130

Class

GPBWire

Namespace

Google\Protobuf\Internal

Code

public static function zigZagDecode64($uint64) {
    if (PHP_INT_SIZE == 4) {
        if (bcmod($uint64, 2) == 0) {
            return bcdiv($uint64, 2, 0);
        }
        else {
            return bcsub(0, bcdiv(bcadd($uint64, 1), 2, 0));
        }
    }
    else {
        return $uint64 >> 1 & 0x7fffffffffffffff ^ -($uint64 & 1);
    }
}
RSS feed
Powered by Drupal