feat: add secure module marketplace runtime (#745)

This commit is contained in:
Darko Gjorgjijoski
2026-08-05 03:49:42 +02:00
committed by GitHub
parent f322c2b74d
commit 8579e4f85f
79 changed files with 2084 additions and 1762 deletions
+20
View File
@@ -0,0 +1,20 @@
<?php
namespace App\Support\Module;
class ModuleAssetVersion
{
public const HASH_LENGTH = 12;
public static function forPath(string $path): ?string
{
$hash = is_file($path) ? hash_file('sha256', $path) : false;
return is_string($hash) ? substr($hash, 0, self::HASH_LENGTH) : null;
}
public static function forContents(string $contents): string
{
return substr(hash('sha256', $contents), 0, self::HASH_LENGTH);
}
}