File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change 16
16
from uuid import uuid4
17
17
18
18
from .manipulation import roman_encode
19
- from .validation import is_integer
20
19
21
20
22
21
def uuid (as_hex : bool = False ) -> str :
@@ -51,7 +50,7 @@ def random_string(size: int) -> str:
51
50
:type size: int
52
51
:return: Random string
53
52
"""
54
- if not is_integer ( str ( size ) ) or size < 1 :
53
+ if not isinstance ( size , int ) or size < 1 :
55
54
raise ValueError ('size must be >= 1' )
56
55
57
56
chars = string .ascii_letters + string .digits
@@ -76,7 +75,7 @@ def secure_random_hex(byte_count: int) -> str:
76
75
:type byte_count: int
77
76
:return: Hexadecimal string representation of generated random bytes
78
77
"""
79
- if not is_integer ( str ( byte_count ) ) or byte_count < 1 :
78
+ if not isinstance ( byte_count , int ) or byte_count < 1 :
80
79
raise ValueError ('byte_count must be >= 1' )
81
80
82
81
random_bytes = os .urandom (byte_count )
You can’t perform that action at this time.
0 commit comments