Do the initial node positions computing pass
@param int $Algorithm
518896
public function firstPass($Algorithm)
    {
        $CenterX = ($this->X2 - $this->X1) / 2 + $this->X1;
        $CenterY = ($this->Y2 - $this->Y1) / 2 + $this->Y1;

        /* Check connections reciprocity */
        foreach ($this->Data as $Key => $Settings) {
            if (isset($Settings["Connections"])) {
                foreach ($Settings["Connections"] as $ID => $ConnectionID) {
                    $this->checkConnection($ConnectionID, $Key);
                }
            }
        }

        if ($this->AutoComputeFreeZone) {
            $this->autoFreeZone();
        }

        /* Get the max number of connections */
        $MaxConnections = 0;
        foreach ($this->Data as $Key => $Settings) {
            if (isset($Settings["Connections"])) {
                if ($MaxConnections < count($Settings["Connections"])) {
                    $MaxConnections = count($Settings["Connections"]);
                }
            }
        }

        if ($Algorithm == ALGORITHM_WEIGHTED) {
            foreach ($this->Data as $Key => $Settings) {
                if ($Settings["Type"] == NODE_TYPE_CENTRAL) {
                    $this->Data[$Key]["X"] = $CenterX;
                    $this->Data[$Key]["Y"] = $CenterY;
                }
                if ($Settings["Type"] == NODE_TYPE_FREE) {
                    if (isset($Settings["Connections"])) {
                        $Connections = count($Settings["Connections"]);
                    } else {
                        $Connections = 0;
                    }

                    $Ring = $MaxConnections - $Connections;
                    $Angle = rand(0, 360);

                    $this->Data[$Key]["X"] = cos(deg2rad($Angle)) * ($Ring * $this->RingSize) + $CenterX;
                    $this->Data[$Key]["Y"] = sin(deg2rad($Angle)) * ($Ring * $this->RingSize) + $CenterY;
                }
            }
        } elseif ($Algorithm == ALGORITHM_CENTRAL) {
            /* Put a weight on each nodes */
            foreach ($this->Data as $Key => $Settings) {
                if (isset($Settings["Connections"])) {
                    $this->Data[$Key]["Weight"] = count($Settings["Connections"]);
                } else {
                    $this->Data[$Key]["Weight"] = 0;
                }
            }

            $MaxConnections = $MaxConnections + 1;
            for ($i = $MaxConnections; $i >= 0; $i--) {
                foreach ($this->Data as $Key => $Settings) {
                    if ($Settings["Type"] == NODE_TYPE_CENTRAL) {
                        $this->Data[$Key]["X"] = $CenterX;
                        $this->Data[$Key]["Y"] = $CenterY;
                    }
                    if ($Settings["Type"] == NODE_TYPE_FREE) {
                        if (isset($Settings["Connections"])) {
                            $Connections = count($Settings["Connections"]);
                        } else {
                            $Connections = 0;
                        }

                        if ($Connections == $i) {
                            $BiggestPartner = $this->getBiggestPartner($Key);
                            if ($BiggestPartner != "") {
                                $Ring = $this->Data[$BiggestPartner]["FreeZone"];
                                $Weight = $this->Data[$BiggestPartner]["Weight"];
                                $AngleDivision = 360 / $this->Data[$BiggestPartner]["Weight"];
                                $Done = false;
                                $Tries = 0;
                                while (!$Done && $Tries <= $Weight * 2) {
                                    $Tries++;
                                    $Angle = floor(rand(0, $Weight) * $AngleDivision);
                                    if (!isset($this->Data[$BiggestPartner]["Angular"][$Angle])
                                        || !isset($this->Data[$BiggestPartner]["Angular"])
                                    ) {
                                        $this->Data[$BiggestPartner]["Angular"][$Angle] = $Angle;
                                        $Done = true;
                                    }
                                }
                                if (!$Done) {
                                    $Angle = rand(0, 360);
                                    $this->Data[$BiggestPartner]["Angular"][$Angle] = $Angle;
                                }

                                $X = cos(deg2rad($Angle)) * ($Ring) + $this->Data[$BiggestPartner]["X"];
                                $Y = sin(deg2rad($Angle)) * ($Ring) + $this->Data[$BiggestPartner]["Y"];

                                $this->Data[$Key]["X"] = $X;
                                $this->Data[$Key]["Y"] = $Y;
                            }
                        }
                    }
                }
            }
        } elseif ($Algorithm == ALGORITHM_CIRCULAR) {
            $MaxConnections = $MaxConnections + 1;
            for ($i = $MaxConnections; $i >= 0; $i--) {
                foreach ($this->Data as $Key => $Settings) {
                    if ($Settings["Type"] == NODE_TYPE_CENTRAL) {
                        $this->Data[$Key]["X"] = $CenterX;
                        $this->Data[$Key]["Y"] = $CenterY;
                    }
                    if ($Settings["Type"] == NODE_TYPE_FREE) {
                        if (isset($Settings["Connections"])) {
                            $Connections = count($Settings["Connections"]);
                        } else {
                            $Connections = 0;
                        }

                        if ($Connections == $i) {
                            $Ring = $MaxConnections - $Connections;
                            $Angle = rand(0, 360);

                            $X = cos(deg2rad($Angle)) * ($Ring * $this->RingSize) + $CenterX;
                            $Y = sin(deg2rad($Angle)) * ($Ring * $this->RingSize) + $CenterY;

                            $MedianOffset = $this->getMedianOffset($Key, $X, $Y);

                            $this->Data[$Key]["X"] = $MedianOffset["X"];
                            $this->Data[$Key]["Y"] = $MedianOffset["Y"];
                        }
                    }
                }
            }
        } elseif ($Algorithm == ALGORITHM_RANDOM) {
            foreach ($this->Data as $Key => $Settings) {
                if ($Settings["Type"] == NODE_TYPE_FREE) {
                    $this->Data[$Key]["X"] = $CenterX + rand(-20, 20);
                    $this->Data[$Key]["Y"] = $CenterY + rand(-20, 20);
                }
                if ($Settings["Type"] == NODE_TYPE_CENTRAL) {
                    $this->Data[$Key]["X"] = $CenterX;
                    $this->Data[$Key]["Y"] = $CenterY;
                }
            }
        }
    }
4949
public function setPassword($password, $algorithm = PasswordFile::ALG_MD5, array $options = null)
    {
        $this->hash = Crypt::hash($password, $algorithm, $options);
    }
1084745
private function _visitNode($node)
    {
        $this->_nodeStates[$node->name] = self::IN_PROGRESS;

        if (isset($this->_relatedClasses[$node->name])) {
            foreach ($this->_relatedClasses[$node->name] as $relatedNode) {
                if ($this->_nodeStates[$relatedNode->name] == self::NOT_VISITED) {
                    $this->_visitNode($relatedNode);
                }
            }
        }

        $this->_nodeStates[$node->name] = self::VISITED;
        $this->_sorted[] = $node;
    }
1209562
private void stackStart(
    GBSNode     node)
  {
    _idx = 0;
    _cidx = 0;
    _state[_cidx] = 0;
    _node[_cidx]  = node;
    _bpidx = _cidx + 1;
    _maxIdx = _cidx;
  }
1114021
public static function hash_init($algorithm)
    {
        if (in_array($algorithm, hash_algos())) {
            // use PHP hash()
            $res = hash_init($algorithm);
        }
        else {
            throw new RuntimeException("Unsupported hash algorithm '" . $algo . "'.");
        }

        //XXX should return Hasher class to keep track of key size
        return $res;
    }
416352
private function dimOffset(ArrayLookupNode $node) {
    $this->mustMatch('[', $node);
    if ($this->currentType !== ']') {
      $node->addChild($this->expr(), 'key');
    }
    $this->mustMatch(']', $node, NULL, TRUE);
  }
539013
private static void allocateNodeLengths(final int[] array) {
        int firstNode = array.length - 2;
        int nextNode = array.length - 1;

        for (int currentDepth = 1, availableNodes = 2; availableNodes > 0; currentDepth++) {
            final int lastNode = firstNode;
            firstNode = first(array, lastNode - 1, 0);

            for (int i = availableNodes - (lastNode - firstNode); i > 0; i--) {
                array[nextNode--] = currentDepth;
            }

            availableNodes = (lastNode - firstNode) << 1;
        }
    }
907453
protected function moveNode()
    {
        if ($this->exists) {
            if (is_null($this->closure->ancestor)) {
                $primaryKey = $this->getKey();
                $this->closure->ancestor = $primaryKey;
                $this->closure->descendant = $primaryKey;
                $this->closure->depth = 0;
            }

            if ($this->isDirty($this->getParentIdColumn())) {
                $this->reorderSiblings(true);
                $this->closure->moveNodeTo($this->parent_id);
            }
        }
    }
267855
public function process($processors = null)
    {
        if ($processors === null) { // Use the default and registered processors.
            $processors = self::processors();
        }
        if (is_array($processors) === false && is_callable($processors)) {
            $processors = [$processors];
        }
        foreach ($processors as $processor) {
            $processor($this);
        }
    }
806891
protected function initialize(): void
    {
        if ($this->result === null) {
            $queryBuilder = $this->elasticSearchQuery->getQueryBuilder();
            $this->result = $queryBuilder->fetch();
            $this->nodes = $this->result['nodes'];
            $this->count = $queryBuilder->getTotalItems();
        }
    }
785732
@Override
	public void propagate(int evtmask) throws ContradictionException {
		// reset
		int n = g.getNbMaxNodes();
		support.getNodes().clear();
		for (int i = 0; i < n; i++) {
			support.getNeighOf(i).clear();
		}
		ISet nodes = g.getMandatoryNodes();
		for (int i : nodes) {
			support.addNode(i);
		}
		for (int i : nodes) {
			ISet nei = g.getPotNeighOf(i);
			for (int j : nei) {
				if (i < j) {
					support.addEdge(i, j);
				}
			}
		}
		delta = n - g.getMandatoryNodes().size();
		// algorithm
		heur.prepare();
		do {
			heur.computeMIS();
			for (R rule : rules) {
				rule.filter(nb, support, heur, this);
			}
		} while (heur.hasNextMIS());
	}
83077
private function _sign($data, $key, $algorithm)
    {
        if ($algorithm === 'HmacSHA1') {
            $hash = 'sha1';
        } else if ($algorithm === 'HmacSHA256') {
            $hash = 'sha256';
        } else {
            throw new Exception ("Non-supported signing method specified");
        }
        return base64_encode(
            hash_hmac($hash, $data, $key, true)
        );
    }
728151
private function array_insert(mixed $object, string $key, int $position) : void
    {
        if (0 == count($this->members)) {
            // The array is empty so just add the item
            $this->members[$key] = $object;
        } elseif ($position == count($this->members)) {
            // The item goes at the end of the array
            $this->members[$key] = $object;
        } else {
            $this->members = array_slice($this->members, 0, $position,
                    true) + array($key => $object) + array_slice($this->members, $position, null, true);
        }
    }
768867
@SuppressWarnings("unchecked")
	protected T init(String algorithm, PrivateKey privateKey, PublicKey publicKey) {
		this.algorithm = algorithm;

		if (null == privateKey && null == publicKey) {
			initKeys();
		} else {
			if (null != privateKey) {
				this.privateKey = privateKey;
			}
			if (null != publicKey) {
				this.publicKey = publicKey;
			}
		}
		return (T) this;
	}
424371
public function getFingerprint(string $algorithm = 'SHA1'): Hash {
        $value = openssl_x509_fingerprint(
            $this->getHandle(),
            $algorithm,
            TRUE
        );
        if(!$value) {
            throw new RuntimeException(OpenSSL::getLastError());
        }
        $hash = new Hash($algorithm);
        $hash->setValue($value);
        return $hash;
    }
1049226
private static function getAlgorithmClass($algorithm)
    {
        if (self::isAlgorithmSupported($algorithm)) {
            return self::getSupportedAlgorithms()[$algorithm];
        }
        throw new \InvalidArgumentException(sprintf('Algorithm "%s" is not supported.', $algorithm));
    }
1242269
final public function beforePutItem(array &$item, Node $node): void
    {
        $this->loadIndexes();
        $this->addShardAttributes($item, $node);
        if ($node instanceof Indexed) {
            $item[NodeTable::INDEXED_KEY_NAME] = ['BOOL' => true];
        }

        foreach ($this->gsi as $gsi) {
            $gsi->beforePutItem($item, $node);
        }

        $this->doBeforePutItem($item, $node);
    }