REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 1.13 KB
Close
//opt/cpanel/ea-wappspector/vendor/rector/rector/src/Util/FileHasher.php
Text
Base64
<?php declare (strict_types=1); namespace Rector\Util; use Rector\Exception\ShouldNotHappenException; /** * @see \Rector\Tests\Util\FileHasherTest */ final class FileHasher { /** * cryptographic insecure hasing of a string */ public function hash(string $string) : string { return \hash($this->getAlgo(), $string); } /** * cryptographic insecure hasing of files * * @param string[] $files */ public function hashFiles(array $files) : string { $configHash = ''; $algo = $this->getAlgo(); foreach ($files as $file) { $hash = \hash_file($algo, $file); if ($hash === \false) { throw new ShouldNotHappenException(\sprintf('File %s is not readable', $file)); } $configHash .= $hash; } return $configHash; } private function getAlgo() : string { //see https://php.watch/articles/php-hash-benchmark if (\PHP_VERSION_ID >= 80100) { // if xxh128 is available use it, as it is way faster return 'xxh128'; } return 'md4'; } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 8
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
Reflection
DIR
-
drwxr-xr-x
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ArrayChecker.php
466 B
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ArrayParametersMerger.php
1.59 KB
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
FileHasher.php
1.13 KB
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
MemoryLimiter.php
1.40 KB
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
NewLineSplitter.php
431 B
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
NodePrinter.php
1.63 KB
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
PhpVersionFactory.php
665 B
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
StringUtils.php
294 B
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).