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 96f3b09 commit 8a68519Copy full SHA for 8a68519
json2xml/dicttoxml.py
@@ -16,18 +16,19 @@
16
import numbers
17
import os
18
from collections.abc import Callable, Sequence
19
-from random import randint
+from random import SystemRandom
20
from typing import Any, Dict, Union
21
22
from defusedxml.minidom import parseString
23
24
+safe_random = SystemRandom()
25
DEBUGMODE = os.getenv("DEBUGMODE", False) # pragma: no cover
26
LOG = logging.getLogger("dicttoxml") # pragma: no cover
27
28
29
def make_id(element: str, start: int = 100000, end: int = 999999) -> str:
30
"""Returns a random integer"""
- return f"{element}_{randint(start, end)}"
31
+ return f"{element}_{safe_random.randint(start, end)}"
32
33
34
def get_unique_id(element: str) -> str:
0 commit comments