Generate random 8-character hex ID for para/durable IDs. Values are constrained to be less than 0x7FFFFFFF per OOXML spec: - paraId must be < 0x80000000 - durableId must be < 0x7FFFFFFF We use the stricter constraint (0x7FFFFFFF) for both.
()
| 594 | |
| 595 | |
| 596 | def _generate_hex_id() -> str: |
| 597 | """Generate random 8-character hex ID for para/durable IDs. |
| 598 | |
| 599 | Values are constrained to be less than 0x7FFFFFFF per OOXML spec: |
| 600 | - paraId must be < 0x80000000 |
| 601 | - durableId must be < 0x7FFFFFFF |
| 602 | We use the stricter constraint (0x7FFFFFFF) for both. |
| 603 | """ |
| 604 | return f"{random.randint(1, 0x7FFFFFFE):08X}" |
| 605 | |
| 606 | |
| 607 | def _generate_rsid() -> str: |
no outgoing calls
no test coverage detected