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

Breadcrumb

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

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

GPBWire

Namespace

Google\Protobuf\Internal

Code

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;
    }
}
RSS feed
Powered by Drupal