Supported Versions: PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8
Calculate the sha1 hash of a string
<?php sha1(string $string, bool $binary = false): string
<?php         }



        $cacheKeyGenerator = function (PackageInterface $package, $key) {

            $cacheKey = sha1($key);



            return $package->getName().'/'.$cacheKey.'.'.$package->getDistType();

        };
<?php         }



        if ($package->getSourceReference()) {

            $nameParts[] = substr(sha1($package->getSourceReference()), 0, 6);

        }



        $name = implode('-', array_filter($nameParts, function ($p) {
<?php             $package['dist'] = array(

                'type' => 'path',

                'url' => $url,

                'reference' => sha1($json . serialize($this->options)),

            );

            $package['transport-options'] = $this->options;

            unset($package['transport-options']['versions']);
<?php         $pemtrim = substr($pubkeypem, strpos($pubkeypem, $start) + strlen($start), (strlen($pubkeypem) - strpos($pubkeypem, $end)) * (-1));

        $der = base64_decode($pemtrim);



        return sha1($der);

    }
<?php             }));



        $expectedUrl = 'foobar';

        $expectedCacheKey = '/'.sha1($expectedUrl).'.';



        $dispatcher = new EventDispatcher(

            $composerMock,
<?php         $expectedUrl = 'url';

        $customCacheKey = 'xyzzy';

        $expectedCacheKey = '/'.sha1($customCacheKey).'.';



        $dispatcher = new EventDispatcher(

            $composerMock,