We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b551e69 commit 2835bb3Copy full SHA for 2835bb3
src/c2pa/c2pa.py
@@ -746,13 +746,11 @@ def __init__(self, file):
746
self._initialized = False
747
self._stream = None
748
749
- # Generate unique stream ID with timestamp
750
- timestamp = int(time.time() * 1000) # milliseconds since epoch
751
-
+ # Generate unique stream ID efficiently using object ID and counter
752
# Safely increment stream ID with overflow protection
753
if Stream._next_stream_id >= Stream._MAX_STREAM_ID:
754
Stream._next_stream_id = 0 # Reset to 0 if we hit the maximum
755
- self._stream_id = f"{timestamp}-{Stream._next_stream_id}"
+ self._stream_id = f"{id(self)}-{Stream._next_stream_id}"
756
Stream._next_stream_id += 1
757
758
# Rest of the existing initialization code...
0 commit comments