e.g., passing in hashAlg has no effect,
const Hash = await require('pure-ipfs-only-hash')
const data = Buffer.from('hello world\n')
hashAlg = 'sha2-256'
cidVersion = 0
await Hash.of(data, {cidVersion, hashAlg})
# 'QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o'
# ... but
hashAlg = 'blake2b-8'
await Hash.of(data, {cidVersion, hashAlg})
# 'QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o'
even though the options object of ipfs-unixfs-importer is supported. For example, setting cidVersion = 1 works as expected.
Should I be using js-multiformats instead?
e.g., passing in
hashAlghas no effect,even though the options object of
ipfs-unixfs-importeris supported. For example, settingcidVersion = 1works as expected.Should I be using
js-multiformatsinstead?