Skip to content

fncode with size of the hash output is not unique #87

Open

Description

@benrayfield

https://github.com/multiformats/multihash/blob/master/hashtable.csv says:
blake2s-256 0xb260
blake2b-256 0xb220

blake2s-256 and blake2b-256 for the same input generate different hashcodes of the same size but have the same fncode 0xb2 and different digsize than their lengths which are both 0x20.

This may be ok for people who store a table of 2 byte codes that each map to a function name and output size, but it does not work for my usecase of only fncode and store size in my own data format which is more general than hashes. I therefore cant use fncode with the actual output size because its not unique and will have to make my own table of fncodes.

Do the hash functions have more parameters than I'm considering? Why is it done this way? Or is the csv file wrong?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions