sha256.convert(bytes).toString() centraliseren (12+ inline kopieen) #2076

Closed
opened 2026-09-13 08:06:00 +00:00 by brenno · 0 comments
Owner

Probleem

sha256.convert(bytes).toString() wordt inline herhaald in 12+ services, terwijl lib/utils/content_hash.dart al een sha512Hex helper biedt. Een sha256Hex/sha256HexOfText helper ontbreekt.

Voorkomens

Bestand Regels
services/duplicate_service.dart 43
services/image_service.dart 572, 709, 730
services/web_asset_store.dart 80, 195
services/evidence_hash_service.dart 23
services/asset_rights_scanner.dart 22, 133-135
services/asset_rights_repository_scanner.dart 55
services/openkat/openkat_directory_scanner.dart 81
services/git/asset_pool.dart 13
services/import/models/source_image.dart 41
services/ociserve/ociserve_gateway.dart 632, 662
services/privacy/dismissal_codec.dart 137
services/privacy/redaction_manifest_service.dart 332

Voorstel

Voeg sha256Hex(List<int> bytes) en sha256HexOfText(String text) toe in lib/utils/content_hash.dart (naast de bestaande sha512Hex). Vervang alle inline calls.

Schatting

~15-20 regels verwijderbaar.

Labels

duplicate, enhancement

## Probleem `sha256.convert(bytes).toString()` wordt inline herhaald in 12+ services, terwijl `lib/utils/content_hash.dart` al een `sha512Hex` helper biedt. Een `sha256Hex`/`sha256HexOfText` helper ontbreekt. ## Voorkomens | Bestand | Regels | |---|---| | `services/duplicate_service.dart` | 43 | | `services/image_service.dart` | 572, 709, 730 | | `services/web_asset_store.dart` | 80, 195 | | `services/evidence_hash_service.dart` | 23 | | `services/asset_rights_scanner.dart` | 22, 133-135 | | `services/asset_rights_repository_scanner.dart` | 55 | | `services/openkat/openkat_directory_scanner.dart` | 81 | | `services/git/asset_pool.dart` | 13 | | `services/import/models/source_image.dart` | 41 | | `services/ociserve/ociserve_gateway.dart` | 632, 662 | | `services/privacy/dismissal_codec.dart` | 137 | | `services/privacy/redaction_manifest_service.dart` | 332 | ## Voorstel Voeg `sha256Hex(List<int> bytes)` en `sha256HexOfText(String text)` toe in `lib/utils/content_hash.dart` (naast de bestaande `sha512Hex`). Vervang alle inline calls. ## Schatting ~15-20 regels verwijderbaar. ## Labels duplicate, enhancement
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
LibreKAT/Ocideck#2076
No description provided.