3 ms·
The Python package `shortuuid` makes working with UUIDs a little easier by encoding them as strings: https://github.com/skorokithakis/shortuuid#usage https://gi
by ivan_ah 6y ago
The Python package `shortuuid` makes working with UUIDs a little easier by encoding them as strings:
https://github.com/skorokithakis/shortuuid#usage https://github.com/skorokithakis/shortuuid#usage
(uses base-57 encoding, with alphabet consisting of A-Za-z0-9 with potentially confusing symbols skipped)
The string representation is what you show to users, but under the hood it's still a UUID and compatible/interoperable with any other system that needs UUID-shaped identifiers.
The coolest part is youcan even truncate the string encodings to get shorter IDs, which correspond to UUIDs with lots of leading zeros.
- rualca 6y ago> The Python package `shortuuid` makes working with UUIDs a little easier by encoding them as strings: This. In my opinion the only issue with UUIDs is that their standard textual representation can be very verbose and cumbersome in some scenarios. A single ID takes over around 40 string characters in a line. That's half the width of a default terminal's width. Thus the solution is obviously to use other textual representations. Instead of base16 then let's ramp up the base to shorten up the text dump, and while we are at it let's pick a readable format.