Compute a hash value for each mod file available for download on the website.
Update the /api/mods/{id} endpoint to include the computed hash value in its response.
Add a new endpoint /api/mods/by-hash to allow searching for mods by their hash value.
Why
Including a hash value for each mod file ensures data integrity and allows users to identify authorship of mod files that have been renamed locally. Additionally, providing a search endpoint by hash value enhances the usability of the API by enabling users to quickly locate specific mod files based on their hash.
Acceptance Criteria
Hash Computation:
A hash value (e.g., MD5, SHA-1) is computed for each mod file available for download. The hash value should be computed and stored at the time of file upload or when the mod file is first made available for download.
Hash values for previously uploaded files are computed retroactively.
Update /api/mods/{id}:
The /api/mods/{id} endpoint includes the computed hash value in its JSON response.
What
/api/mods/{id}
endpoint to include the computed hash value in its response./api/mods/by-hash
to allow searching for mods by their hash value.Why
Including a hash value for each mod file ensures data integrity and allows users to identify authorship of mod files that have been renamed locally. Additionally, providing a search endpoint by hash value enhances the usability of the API by enabling users to quickly locate specific mod files based on their hash.
Acceptance Criteria
Hash Computation:
Update /api/mods/{id}:
/api/mods/{id}
endpoint includes the computed hash value in its JSON response.Add /api/mods/by-hash:
/api/mods/by-hash
is created.hash
and returns the mod details if a mod with the specified hash exists.GET /api/mods/by-hash?hash=abc123def4567890abc123def4567890