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

hashAlg not set #24

Open
robinsonkwame opened this issue May 13, 2022 · 0 comments
Open

hashAlg not set #24

robinsonkwame opened this issue May 13, 2022 · 0 comments

Comments

@robinsonkwame
Copy link

robinsonkwame commented May 13, 2022

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?

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

1 participant