ipld / interface-ipld-format

A interface you can follow to implement a valid IPLD format, resolvable through the IPLD Resolver (available in IPFS)
Other
29 stars 5 forks source link

Add `defaultHashAlg` property #20

Closed vmx closed 6 years ago

vmx commented 6 years ago

If data is inserted into IPLD you need to specify the format as well as the hash that is used. For many formats there's a default hash (often there's even only a single hash type possible). If a format has such a default has, a property on the resolver called defaultHashAlg would be defined.

This way you often won't need to specify the hash type (you might not even know it), but only the format. Examples are:

What do others think of that idea?

daviddias commented 6 years ago

👍 Sounds good to me. Is the spec the right place to specify this?

vmx commented 6 years ago

I think the spec is the right place to specify it.

vmx commented 6 years ago

I've changed the property name to 'defaultHashAlg` to be more consistent.

daviddias commented 6 years ago

I like it!