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

Issue with block get and keccak256 - illegal base32 data at input byte X #4741

Closed
XertroV opened this issue Feb 27, 2018 · 1 comment
Closed

Comments

@XertroV
Copy link

XertroV commented Feb 27, 2018

Version information:

0.4.13

Type:

Bug

Description:

Using ipfs block put and then ipfs block get can result in an exception being thrown.

Easy to demo:

╰─➤  echo '{"hi": "there"}' | ipfs block put --mhtype keccak-256
cZsyN1Re3C3wayTpNMMAHS8NYLbU7CJABUv63cF4V4yT3b

╰─➤  ipfs block get cZsyN1Re3C3wayTpNMMAHS8NYLbU7CJABUv63cF4V4yT3b
Error: illegal base32 data at input byte 4

This doesn't happen with other hashing algs (though sha3-256 doesn't work for a different reason):

╰─➤  echo '{"hi": "there"}' | ipfs block put
QmctZwqj5wpathnW2vW1dujTGAEWap4kbuGV9uhWGDTqw3

╰─➤  ipfs block get QmctZwqj5wpathnW2vW1dujTGAEWap4kbuGV9uhWGDTqw3
{"hi": "there"}

╰─➤  echo '{"hi": "there"}' | ipfs block put --mhtype sha3-256
W1ke9EmidoZq1gzEffrPJsCC55iuWijqoXfgaejB1KRv1K

╰─➤  ipfs block get W1ke9EmidoZq1gzEffrPJsCC55iuWijqoXfgaejB1KRv1K
Error: selected encoding not supported

It'd be really nice to use keccak-256 because it's the cheapest on Ethereum.

@magik6k
Copy link
Member

magik6k commented Mar 2, 2018

This is caused by block put not switching to cidv1 when a custom multihash settings are provided. This is already fixed in #4563

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

2 participants