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

Breadcrumb

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

function GenericRule::getHash

@inheritDoc

Overrides Rule::getHash

File

vendor/composer/composer/src/Composer/DependencyResolver/GenericRule.php, line 47

Class

GenericRule
@author Nils Adermann <naderman@naderman.de>

Namespace

Composer\DependencyResolver

Code

public function getHash() {
    $data = unpack('ihash', (string) hash(\PHP_VERSION_ID > 80100 ? 'xxh3' : 'sha1', implode(',', $this->literals), true));
    if (false === $data) {
        throw new \RuntimeException('Failed unpacking: ' . implode(', ', $this->literals));
    }
    return $data['hash'];
}

API Navigation

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