Files
SkinbaseNova/.deploy/artwork-evolution-release/app/Services/Uploads/UploadHashService.php
2026-04-18 17:02:56 +02:00

22 lines
366 B
PHP

<?php
declare(strict_types=1);
namespace App\Services\Uploads;
use RuntimeException;
final class UploadHashService
{
public function hashFile(string $path): string
{
$hash = hash_file('sha256', $path);
if ($hash === false) {
throw new RuntimeException('Failed to hash upload file.');
}
return $hash;
}
}