From ae113f91fefff415898781272b892d670fcb46f4 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 14 Jun 2026 17:18:44 +0900 Subject: feat(php-shim): implement random_int/random_bytes with fastrand PHP's random_int/random_bytes are cryptographically secure, but Composer does not rely on that property, so a non-cryptographic PRNG suffices. Co-Authored-By: Claude Opus 4.8 --- crates/shirabe/src/downloader/zip_downloader.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/shirabe/src/downloader') diff --git a/crates/shirabe/src/downloader/zip_downloader.rs b/crates/shirabe/src/downloader/zip_downloader.rs index d4ec2ab..2eb7b94 100644 --- a/crates/shirabe/src/downloader/zip_downloader.rs +++ b/crates/shirabe/src/downloader/zip_downloader.rs @@ -307,7 +307,7 @@ impl ZipDownloader { let stat_index = if inspect_all { i } else { - random_int(0, total_files - 1) + random_int(0..total_files) }; if let Some(stat) = zip_archive.stat_index(stat_index) { let size = stat.get("size").and_then(|v| v.as_int()).unwrap_or(0); -- cgit v1.3.1