AnonymousSpottedToad/securityPatternsRecovery / codebase /repos /python /Athroniaeth_keyshield /src /keyshield /utils.py
| import secrets | |
| import string | |
| import uuid | |
| from datetime import datetime, timezone | |
| def uuid_factory() -> str: | |
| """Helper function to create a UUID string.""" | |
| return uuid.uuid4().hex | |
| def key_id_factory() -> str: | |
| """Helper function to create unique key_id for API keys.""" | |
| return uuid_factory()[:16] | |
| def key_secret_factory(length: int = 64) -> str: | |
| """Helper function to create a secure random plain key.""" | |
| alphabet = string.ascii_letters + string.digits # 62 chars | |
| return "".join(secrets.choice(alphabet) for _ in range(length)) | |
| def datetime_factory() -> datetime: | |
| """Helper function to create a timezone-aware datetime object.""" | |
| return datetime.now(timezone.utc) | |
Xet Storage Details
- Size:
- 707 Bytes
- Xet hash:
- b87f7060f4a8f3cfc306c85e373cb25c5cf2c8520b36aa7e0df750d9a33e14f4
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.