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

Breadcrumb

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

function GPBUtil::combineInt32ToInt64

2 calls to GPBUtil::combineInt32ToInt64()
CodedInputStream::readLittleEndian64 in vendor/google/protobuf/src/Google/Protobuf/Internal/CodedInputStream.php
Read 64-bit unsigned integer to $var. If the buffer has less than 8 bytes, return false. Advance buffer with consumed bytes.
CodedInputStream::readVarint64 in vendor/google/protobuf/src/Google/Protobuf/Internal/CodedInputStream.php
Read Uint64 into $var. Advance buffer with consumed bytes.

File

vendor/google/protobuf/src/Google/Protobuf/Internal/GPBUtil.php, line 410

Class

GPBUtil

Namespace

Google\Protobuf\Internal

Code

public static function combineInt32ToInt64($high, $low) {
    $isNeg = $high < 0;
    if ($isNeg) {
        $high = ~$high;
        $low = ~$low;
        $low++;
        if (!$low) {
            $high = (int) ($high + 1);
        }
    }
    $result = bcadd(bcmul($high, 4294967296), $low);
    if ($low < 0) {
        $result = bcadd($result, 4294967296);
    }
    if ($isNeg) {
        $result = bcsub(0, $result);
    }
    return $result;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal