MCPcopy Create free account
hub / github.com/SpaceZephyr/myskill / _generate_hex_id

Function _generate_hex_id

docx/scripts/document.py:596–604  ·  view source on GitHub ↗

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.

()

Source from the content-addressed store, hash-verified

594
595
596def _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
607def _generate_rsid() -> str:

Callers 3

add_rsid_to_pMethod · 0.85
add_commentMethod · 0.85
reply_to_commentMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected