Computes hash of \Google\Protobuf\SourceCodeInfo

@param object $object
@param string|resource $algoOrCtx
@param bool $raw

@return string|void
971525
public static function hash($object, $algoOrCtx = 'md5', $raw = FALSE)
	{
		if (is_string($algoOrCtx)) {
			$ctx = hash_init($algoOrCtx);
		} else {
			$ctx = $algoOrCtx;
		}

		if (isset($object->location)) {
			hash_update($ctx, 'location');
			foreach ($object->location instanceof \Traversable ? $object->location : (array)$object->location as $v0) {
				LocationMeta::hash($v0, $ctx);
			}
		}

		if (is_string($algoOrCtx)) {
			return hash_final($ctx, $raw);
		} else {
			return null;
		}
	}
450093
public function toBinary($hashAlgo)
	{
		$s = self::SIGNATURE1 . self::SIGNATURE2 . self::VERSION
			. self::fieldToString(2, $this->cipher)
			. self::fieldToString(3,
			$this->compression == self::COMPRESSION_GZIP
				? self::INT_1 : self::INT_0)
			. self::fieldToString(4, $this->masterSeed)
			. self::fieldToString(5, $this->transformSeed)
			. self::fieldToString(6, $this->rounds)
			. self::fieldToString(7, $this->encryptionIV)
			. self::fieldToString(8, $this->randomStreamKey)
			. self::fieldToString(9, $this->startBytes)
			. self::fieldToString(10,
			$this->randomStream == self::RANDOMSTREAM_SALSA20
				? self::INT_2 : self::INT_0)
			. self::fieldToString(0, null);
		$this->headerHash = hash($hashAlgo, $s, true);
		return $s;
	}
725681
function JSON($object = null) {
		header("Expires: Mon, 26 Jul 1997 05:00:00 GMT" ); 
		header("Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . "GMT" ); 
		header("Cache-Control: no-cache, must-revalidate" ); 
		header("Pragma: no-cache" );
		header('Content-type: application/json');

		if (is_array($object)) {
			echo json_encode($object, $this->JSONOptions);
		} else if (is_bool($object)) {
			echo 0;
		} else if (is_string($object)) {
			echo $object;
		} else if (is_null($object)) {
			echo 'null';
		} else {
			die('Unknown object type to convert into JSON: ' . gettype($object));
		}

		if ($this->fatal)
			exit;
	}
646921
public function populate($object, array $data)
    {
        if (!is_object($object)) {
            throw new \InvalidArgumentException('The first param should be a object.');
        }

        if ($object instanceof Array2ObjectInterface) {
            $object->__populate($data);
        } else {
            //this static cache is helpful when populate
            //many objects of the same type in a loop
            static $matcherCache = [];
            static $writerCache = [];

            $objectClass = get_class($object);
            $properties = Utils::getClassProperties($objectClass);
            foreach ($properties as $property) {
                //save in cache if the property is writable
                $writableCacheHash = $objectClass.$property->getName();
                if (!isset($writerCache[$writableCacheHash])) {
                    $writerCache[$writableCacheHash] = $this->context->getWriter()->isWritable($object, $property->getName());
                }
                foreach ($data as $key => $value) {
                    //save in cache if the property name match with key
                    $propHash = $objectClass.$property->getName().$key;
                    if (!isset($matcherCache[$propHash])) {
                        $matcherCache[$propHash] = $this->context->getMatcher()->match($property, $key);
                    }

                    if ($writerCache[$writableCacheHash] && $matcherCache[$propHash]) {
                        $types = Utils::getPropertyTypes($property);
                        $value = $this->parseValue($value, $types, $property, $object);
                        $this->context->getWriter()->setValue($object, $property->getName(), $value);
                    }
                }
            }
        }
    }
233439
public function getHash($algo = 'sha1', $raw = false)
    {
        $result = false;

        if ($this->isReadable() && $this->isSeekable())
        {
            $current = $this->peek();
            if ($this->seek(0) && in_array($algo, hash_algos()))
            {
                $hash = hash_init($algo);
                hash_update_stream($hash, $this->_resource);
                $result = hash_final($hash, (bool) $raw);
                $this->seek($current);
            }
        }

        return $result;
    }
1314138
public function getServerPublicKey($raw = false)
    {
        if ($raw) {
            return $this->publicKeyContent;
        }

        return Base64Url::encode($this->publicKeyContent);
    }
1075144
public function csproHashFile($friendlyDirective, $string, $algo = null)
    {
        Types::assert(
            ['string' => [$friendlyDirective, $string], '?string' => [$algo]]
        );

        return $this->cspHash($friendlyDirective, $string, $algo, true, true);
    }
81712
private function configure($object, $config, $configAttribute)
    {
        if (isset($config[$configAttribute]) === false) {
            return $object;
        }
        foreach ($config[$configAttribute] as $key => $value) {
            if (property_exists($object, $key)) {
                // we are storing all iso codes in lower case
                if (strpos($key, 'iso') === 0) {
                    $value = strtolower($value);
                }
                $object->$key = $value;
            }
        }
        return $object;
    }
1150543
static function find_all_tags_string($object, $where = array())
	{
		$data = array(
			'target_class_id IN' => array($object->extends_class_id(), $object->class_id()),
			'target_object_id' => $object->id(),
		);

		$bindings = bors_find_all('common_keyword_bind', array_merge($data, $where));
		$tag_ids = bors_field_array_extract($bindings, 'keyword_id');
		$tags = bors_find_all(__CLASS__, array('id IN' => $tag_ids));
		return join(', ', bors_field_array_extract($tags, 'title'));
	}
95473
public function generateHash($object)
    {
        if (!is_object($object)) {
            throw new InvalidArgumentException(1, 'object');
        }

        $properties = call_user_func($this->propertyReader, $object);
        ksort($properties);

        if (isset($properties['__freezer'])) {
            unset($properties['__freezer']);
        }

        foreach ($properties as $name => $value) {
            if (is_array($value)) {
                $properties[$name] = '<array>';
            } elseif (is_object($value)) {
                if (!isset($value->{$this->idProperty})) {
                    $value->{$this->idProperty} = $this->generateId();
                }

                $properties[$name] = (string)$value->{$this->idProperty};
            } elseif (is_resource($value)) {
                $properties[$name] = null;
            }
        }

        return sha1(get_class($object) . join(':', $properties));
    }
653673
public function hash($algo = 'md5', $format = null, $raw_output = false)
	{
		return hash($algo, parent::format($format === null ? static::$format : $format), $raw_output);
	}
164038
public static int hash(int aSeed, Object aObject)
   {
      int result = aSeed;
      if (aObject == null)
      {
         result = org.jboss.ws.common.utils.HashCodeUtil.hash(result, 0);
      }
      else if (!org.jboss.ws.common.utils.HashCodeUtil.isArray(aObject))
      {
         result = org.jboss.ws.common.utils.HashCodeUtil.hash(result, aObject.hashCode());
      }
      else
      {
         int length = Array.getLength(aObject);
         for (int idx = 0; idx < length; ++idx)
         {
            Object item = Array.get(aObject, idx);
            //recursive call!
            result = org.jboss.ws.common.utils.HashCodeUtil.hash(result, item);
         }
      }
      return result;
   }
390696
protected function crudEditRedirectUrl($object)
    {
        $identifierMethod = $this->crudIdentifierMethod();

        return $this->crudGenerateRoute($this->crudEditRoute(), array('id' => $object->$identifierMethod()));
    }
730747
public function computeHash($publicKeyDER, $hashAlgorithm)
    {
        try {
            return (new CryptoVirgilHash($hashAlgorithm))->hash($publicKeyDER);
        } catch (Exception $exception) {
            throw new PublicKeyHashComputationException($exception->getMessage(), $exception->getCode());
        }
    }
778284
public static function encode($payload, $key, $algo = 'HS256', $additionalHeaders = array()) {
        $header = array('typ' => 'JWT', 'alg' => $algo);
        $header = $header + $additionalHeaders;

        $segments = array();
        $segments[] = self::urlsafeB64Encode(self::jsonEncode($header));
        $segments[] = self::urlsafeB64Encode(self::jsonEncode($payload));
        $signing_input = implode('.', $segments);

        $signature = self::sign($signing_input, $key, $algo);
        $segments[] = self::urlsafeB64Encode($signature);

        return implode('.', $segments);
    }
939328
public static function hash($object, $algoOrCtx = 'md5', $raw = FALSE)
	{
		if (is_string($algoOrCtx)) {
			$ctx = hash_init($algoOrCtx);
		} else {
			$ctx = $algoOrCtx;
		}

		if (isset($object->deprecated)) {
			hash_update($ctx, 'deprecated');
			hash_update($ctx, (string)$object->deprecated);
		}

		if (isset($object->uninterpretedOption)) {
			hash_update($ctx, 'uninterpretedOption');
			foreach ($object->uninterpretedOption instanceof \Traversable ? $object->uninterpretedOption : (array)$object->uninterpretedOption as $v0) {
				UninterpretedOptionMeta::hash($v0, $ctx);
			}
		}

		if (is_string($algoOrCtx)) {
			return hash_final($ctx, $raw);
		} else {
			return null;
		}
	}
949922
public function crudEditObject(Request $request, $object, array $templateVars = array())
    {
        if (!is_object($object)) {
            /** @var ObjectRepository $repo */
            $repo = $this->crudRepositoryForClass($this->crudObjectClass());
            $object = $repo->find($object);
        }

        if (null === $object) {
            throw new NotFoundHttpException('There is no object with this id');
        }

        if (!$this->crudEditIsGranted($object)) {
            throw new AccessDeniedException('You need the permission to edit this object!');
        }

        $form = $this->crudForm($this->crudEditFormType($object), $object);

        if ('POST' === $request->getMethod()) {
            $form->handleRequest($request);
            if ($this->crudEditIsSubmitted($form)) {
                if ($form->isValid()) {
                    $this->crudEditPrePersist($object);

                    $em = $this->crudManagerForClass($this->crudObjectClass());
                    $em->persist($object);
                    $em->flush();

                    $this->crudEditPostFlush($object);

                    $this->crudFlashMessage($request, 'success', sprintf('%s.edit.flash.success', $this->crudTransPrefix()));

                    return new RedirectResponse($this->crudEditRedirectUrl($object), 302);
                } else {
                    $this->crudFlashMessage($request, 'error', sprintf('%s.edit.flash.error', $this->crudTransPrefix()));
                }
            }
        }

        $baseTemplateVars = array(
            'request' => $request,
            'object' => $object,
            'form' => $form->createView(),
            'createRoute' => $this->crudCreateRoute(),
            'listRoute' => $this->crudListRoute(),
            'editRoute' => $this->crudEditRoute(),
            'viewRoute' => $this->crudViewRoute(),
            'deleteRoute' => $this->crudDeleteRoute(),
            'listRole' => $this->crudListRole(),
            'createRole' => $this->crudCreateRole(),
            'editRole' => $this->crudEditRole(),
            'viewRole' => $this->crudViewRole(),
            'deleteRole' => $this->crudDeleteRole(),
            'identifier' => $this->crudIdentifier(),
            'transPrefix' => $this->crudTransPrefix(),
            'objectClass' => $this->crudObjectClass(),
        );

        return $this->crudRender(
            $this->crudEditTemplate(),
            array_replace_recursive($baseTemplateVars, $templateVars)
        );
    }