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

allow configuration of ipldStores default hash function #86

Merged
merged 1 commit into from
Jan 26, 2023

Conversation

whyrusleeping
Copy link
Member

No description provided.

@@ -89,7 +93,11 @@ type cidProvider interface {

// Put marshals and writes content `v` to the backing blockstore returning its CID.
func (s *BasicIpldStore) Put(ctx context.Context, v interface{}) (cid.Cid, error) {
mhType := uint64(mh.BLAKE2B_MIN + 31)
mhType := DefaultMultihash
if s.DefaultMultihash != 0 {
Copy link
Member

Choose a reason for hiding this comment

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

Hm.... this technically conflicts with the identity hash. I mean, that doesn't make sense as the default anyways, so maybe we're fine.

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess I could make it a pointer?

Copy link
Member Author

Choose a reason for hiding this comment

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

though if you really want the identity hash you can use the cid provider thing right?

Copy link
Member

Choose a reason for hiding this comment

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

Yep. And, honestly, you shouldn't make the default "identity". That's just absolutely stupid.

@whyrusleeping whyrusleeping merged commit 86b9376 into master Jan 26, 2023
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

Successfully merging this pull request may close these issues.

2 participants