dwyl / cid

❄️cid ("content id") is a human-friendly (readable/typeable) unique ID function built for distributed/decentralised systems.
GNU General Public License v2.0
33 stars 3 forks source link

Compiling warnings + Cid.cid/1 undefined #46

Open ndrean opened 11 months ago

ndrean commented 11 months ago

2 pb:

Screenshot 2023-08-26 at 09 01 57
warning: defp is_valid_hash_code/1 is private, @doc attribute is always discarded for private functions/macros/types
  lib/multihash.ex:178: Multihash.is_valid_hash_code/1

warning: defp encode_internal/3 is private, @doc attribute is always discarded for private functions/macros/types
  lib/multihash.ex:185: Multihash.encode_internal/3

warning: defp decode_internal/3 is private, @doc attribute is always discarded for private functions/macros/types
  lib/multihash.ex:196: Multihash.decode_internal/3

warning: defp check_length/2 is private, @doc attribute is always discarded for private functions/macros/types
  lib/multihash.ex:209: Multihash.check_length/2

warning: defp check_truncated_digest_length/3 is private, @doc attribute is always discarded for private functions/macros/types
  lib/multihash.ex:219: Multihash.check_truncated_digest_length/3

warning: defp check_digest_length/2 is private, @doc attribute is always discarded for private functions/macros/types
  lib/multihash.ex:229: Multihash.check_digest_length/2

warning: defp get_hash_info/1 is private, @doc attribute is always discarded for private functions/macros/types
  lib/multihash.ex:239: Multihash.get_hash_info/1

warning: defp get_hash_function/1 is private, @doc attribute is always discarded for private functions/macros/types
  lib/multihash.ex:245: Multihash.get_hash_function/1

warning: defp get_from_dict/3 is private, @doc attribute is always discarded for private functions/macros/types
  lib/multihash.ex:251: Multihash.get_from_dict/3

warning: incompatible types:

    float() !~ integer()

in expression:

    # lib/multihash.ex:87
    <<hash_code>>

where "hash_code" was given the type integer() | float() in:

    # lib/multihash.ex:86
    is_number(hash_code)

where "hash_code" was given the type integer() in:

    # lib/multihash.ex:87
    <<hash_code>>

HINT: all expressions given to binaries are assumed to be of type integer() unless said otherwise. For example, <<expr>> assumes "expr" is an integer. Pass a modifier, such as <<expr::float>> or <<expr::binary>>, to change the default behaviour.

Conflict found at
  lib/multihash.ex:87: Multihash.encode/3
nelsonic commented 10 months ago

This is very strange. We haven't seen this on our side. 🤷‍♂️ Please test with the latest version of excid and confirm if it's still happening. 🙏

ndrean commented 10 months ago

Yes it was 1.0, and I ran it 2 times (cleaned mix.lock & deps). So meanwhile I changed to produce a hash whilst stream reading a file (in case it is big) and use the hash as the filename. Starting to think my computer is haunted.