We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7aea820 commit 5f0584fCopy full SHA for 5f0584f
1 file changed
cuenca_validations/types/helpers.py
@@ -1,4 +1,5 @@
1
import datetime as dt
2
+import random
3
import uuid
4
from base64 import urlsafe_b64encode
5
from typing import Callable, Optional, Union
@@ -13,7 +14,8 @@
13
14
def uuid_field(prefix: str = '') -> Callable[[], str]:
15
def base64_uuid_func() -> str:
16
base64_str = urlsafe_b64encode(uuid.uuid4().bytes).decode()[:-2]
- sanitized = base64_str.replace('-', 'A').replace('_', 'B')
17
+ rnd = str(random.randint(0, 9))
18
+ sanitized = base64_str.replace('-', rnd).replace('_', rnd)
19
return prefix + sanitized
20
21
return base64_uuid_func
0 commit comments