Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Commit

Permalink
Merge pull request #11 from libp2p/fix/issue-10
Browse files Browse the repository at this point in the history
correctly encode ns to CID
  • Loading branch information
vyzo authored Feb 14, 2019
2 parents d4858e0 + cdcf11e commit 17aa7d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion routing.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (d *RoutingDiscovery) FindPeers(ctx context.Context, ns string, opts ...Opt
}

func nsToCid(ns string) (cid.Cid, error) {
h, err := mh.Encode([]byte(ns), mh.SHA2_256)
h, err := mh.Sum([]byte(ns), mh.SHA2_256, -1)
if err != nil {
return cid.Undef, err
}
Expand Down

0 comments on commit 17aa7d7

Please sign in to comment.