Skip to content
This repository has been archived by the owner on Aug 12, 2020. It is now read-only.

Sanitize multihash input. #52

Merged
merged 1 commit into from
Aug 5, 2016
Merged

Conversation

hackergrrl
Copy link
Contributor

@hackergrrl hackergrrl commented Jul 14, 2016

The root node returned by the exporter uses the hash input, so it's important we make sure it's always a base58-encoded string, since a multihash Buffer is also valid input here.

throw new Error('not valid multihash')
}
if (Buffer.isBuffer(multihash)) {
return bs58.encode(multihash)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We now have the needed methods for this on js-multihash, please use those instead of b58 directly https://github.com/multiformats/js-multihash#api

@daviddias
Copy link
Contributor

LGTM, thank you :)

@dignifiedquire
Copy link
Contributor

LGTM

@daviddias
Copy link
Contributor

Squash for the merge :D

@hackergrrl
Copy link
Contributor Author

hackergrrl commented Aug 4, 2016

Squished and rebased!

@daviddias daviddias merged commit f263791 into ipfs-inactive:master Aug 5, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants