File size: 702 Bytes
cfdd165
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# backend/utils/

## Responsibility
Contains shared low-level utility functions; currently `hash_utils.py` provides deterministic file-content hashing.

## Design
- Stateless standard-library helper `calculate_file_hash(content: bytes) -> str` computes SHA-256 and returns a lowercase hexadecimal digest.
- No I/O, external dependency, configuration, or mutable state.

## Flow
Caller supplies complete file bytes → `hashlib.sha256(content).hexdigest()` → caller uses digest for identity/deduplication.

## Integration
Imported as `utils.hash_utils.calculate_file_hash`; `backend/tests/test_hash_utils.py` covers the helper. No Firestore collection or service dependency is defined in this folder.