(uuid: UUID)
| 2 | |
| 3 | |
| 4 | def encode_uuid(uuid: UUID) -> str: |
| 5 | uuid_int = uuid.int |
| 6 | base = 52 |
| 7 | charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" |
| 8 | |
| 9 | encoded = "" |
| 10 | while len(encoded) < 36: |
| 11 | uuid_int, remainder = divmod(uuid_int, base) |
| 12 | uuid_int = uuid_int * 8 |
| 13 | encoded = charset[remainder] + encoded |
| 14 | |
| 15 | return encoded |
nothing calls this directly
no outgoing calls
no test coverage detected