JasterV
Any other libraries to create UUIDv4 beside Ecto?
So I don’t depend on Ecto but I need a well maintained library to generate unique identifiers.
The only library other than ecto seems to be “elixir-uuid”, but it hasnt been updated in ages and when I use it I get many warnings because of deprecated stuff. I’ve checked the issues on Github and some of them even state that the generated UUIDs can sometimes be duplicated…
So the only other option I see is using Ecto.UUID… but I don’t want to import this huge library only to use the UUID functionality
Any ideas here?
Most Liked
benwilson512
My guess is that:
- Most projects already have ecto. Even if you aren’t using a database, its changesets, embedded schemas, and validators are useful.
- The rest just copy in the ~50 lines of code from here ecto/lib/ecto/uuid.ex at v3.11.2 · elixir-ecto/ecto · GitHub
Someone certainly could extract that to a library but it’s also just not that many lines of code, and they aren’t gonna change.
Marcus
I have also a reimplementation of elixir_uuid | Hex and uuid_utils | Hex . Not released yet, but if it can help I make a release. GitHub - hrzndhrn/ex_uuid: UUID generator according to RFC 4122 · GitHub
entone
There are quite a few forks of the repo, you could look into those. Forks · zyro/elixir-uuid · GitHub
If a library hasn’t been updated in a while, maybe the author has moved on, I’ll also look at open pull requests to see if anyone has made the changes I need, and can move to that version. Pull requests · zyro/elixir-uuid · GitHub
If the changes I want haven’t been made, then I make them
yay open source!
Last Post!
zookzook
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #hex
- #security









