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

Check length and handle varints #2

Closed
Stebalien opened this issue Jul 18, 2018 · 1 comment
Closed

Check length and handle varints #2

Stebalien opened this issue Jul 18, 2018 · 1 comment

Comments

@Stebalien
Copy link

constructor(hash: ByteArray) : this(Type.lookup((hash[0].toInt() and 0xff)), Arrays.copyOfRange(hash, 2, hash.size))

Both the hash type and the length are varints (ipfs/kubo#4197). While the constructor will usually just treat these as "unsupported" (as far as I can tell), large identity multihash's will fail badly (you'll get garbage at the beginning of the hash).

@changjiashuai
Copy link
Owner

Refactor in v1.1.0

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