1) { echo " Plusieurs candidats : " . implode(', ', array_map('basename', $candidates)) . "\n"; } continue; } } $size = filesize($zip); echo " [hash] $version : " . basename($zip) . " ($size octets)..."; $sha = hash_file('sha256', $zip); echo " sha256={$sha}\n"; $v['download']['sizeBytes'] = $size; $v['download']['sha256'] = $sha; $updated++; } unset($v); // (v0.4) Signature Ed25519 — pour l'instant on laisse 'signature' = null. // $config = require __DIR__ . '/../api/config.php'; // $sk = sodium_hex2bin($config['ed25519']['private_key_hex']); // $payload = json_encode($manifest, JSON_UNESCAPED_SLASHES); // $manifest['signature'] = base64_encode(sodium_crypto_sign_detached($payload, $sk)); file_put_contents( $manifestPath, json_encode($manifest, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\n" ); echo "Manifest mis à jour ({$updated} version(s)) : $manifestPath\n";