Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crypto warning when compiling #60

Open
pdgonzalez872 opened this issue Dec 14, 2021 · 2 comments
Open

Crypto warning when compiling #60

pdgonzalez872 opened this issue Dec 14, 2021 · 2 comments

Comments

@pdgonzalez872
Copy link

Hi! Thanks for the lib!

I'm getting this when compiling:

==> elixir_uuid
Compiling 1 file (.ex)
warning: :crypto.hash/2 defined in application :crypto is used by the current application but the current application does not depend on :crypto. To fix this, you must do one of:

  1. If :crypto is part of Erlang/Elixir, you must include it under :extra_applications inside "def application" in your mix.exs

  2. If :crypto is a dependency, make sure it is listed under "def deps" in your mix.exs

  3. In case you don't want to add a requirement to :crypto, you may optionally skip this warning by adding [xref: [exclude: [:crypto]]] to your "def project" in mix.exs

Found at 2 locations:
  lib/uuid.ex:589: UUID.namebased_uuid/2
  lib/uuid.ex:593: UUID.namebased_uuid/2

warning: :crypto.strong_rand_bytes/1 defined in application :crypto is used by the current application but the current application does not depend on :crypto. To fix this, you must do one of:

  1. If :crypto is part of Erlang/Elixir, you must include it under :extra_applications inside "def application" in your mix.exs

  2. If :crypto is a dependency, make sure it is listed under "def deps" in your mix.exs

  3. In case you don't want to add a requirement to :crypto, you may optionally skip this warning by adding [xref: [exclude: [:crypto]]] to your "def project" in mix.exs

Found at 3 locations:
  lib/uuid.ex:383: UUID.uuid4/1
  lib/uuid.ex:560: UUID.uuid1_clockseq/0
  lib/uuid.ex:583: UUID.uuid1_node/1

Generated elixir_uuid app

Here are my versions:

Erlang/OTP 24 [erts-12.0.1] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit]

Interactive Elixir (1.12.0) - press Ctrl+C to exit (type h() ENTER for help)

but I also tested this on 1.11-OTP 22 and we get the same warning.

Would you welcome a PR that fixed the warning? I'll create one, feel free to merge if you'd like!

Thanks for the library!

@Hentioe
Copy link

Hentioe commented May 21, 2022

This library has not been maintained for a long time, and no PRs have been merged. I recommend you to use the Erlang library https://github.com/okeuday/uuid.

Create a uuid like this:

iex> :uuid.get_v4() |> :uuid.uuid_to_string() |> List.to_string()
"17c2237c-144b-41bc-a872-a9d135678209"

@louiscb
Copy link

louiscb commented Sep 13, 2022

For future users who want to start using the Erlang library I wanted to add a couple comments:

The following executes much faster than the built in :uuid string conversion as mentioned above.

  :uuid.get_v4() |> Ecto.UUID.load()

If you're using uuid v3 and want backwards compatibility with elixir-uuid and the Erlang UUID then you need to use this method:

 :uuid.get_v3_compat(<<0::128, data::binary>>)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants