Replies: 5 comments
-
Not really. UUIDs conform to a known standard, so modifying the existing implementation feels wrong. You might instead want to have a look at https://hashids.org/ They have a javascript implementation and a wrapper for that would make a nice addition to this library. |
Beta Was this translation helpful? Give feedback.
-
You could take a look at https://github.com/skorokithakis/shortuuid/ You might be able to adapt some of the functions to work with the Specifically following the rabbit hole starting from I'd be ok with |
Beta Was this translation helpful? Give feedback.
-
Understood @meatballs. Ok great I will go through and see how it looks. |
Beta Was this translation helpful? Give feedback.
-
My thought on how to approach was to use a Javascript library as the base so that the short version can be generated on the client - otherwise you would just a python library. After reading through both links above and doing a bit of searching, I figured that without revinenting the wheel I could use the Short Unique ID library (https://shortunique.id/). I have done this in my current code in Anvil Native Libraries and it works - maybe not elegantly but it works. Could this be a way forward?
|
Beta Was this translation helpful? Give feedback.
-
I could get behind something like this. One issue you'll find @rhurlbatt is including your javascript code inside a python module. There is a helper function Other things:
|
Beta Was this translation helpful? Give feedback.
-
I have a need for a short uuid (to create a unique name for an IndexedDB database) in client code.
Could the UUID module be modified to suit? If so, I would like to have a crack at contributing but will need to be pointed in the right direction.
Beta Was this translation helpful? Give feedback.
All reactions