Skip to content
This repository was archived by the owner on Dec 7, 2019. It is now read-only.

switch to mr-tron's b58 library #24

Merged
merged 1 commit into from
Dec 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
},
{
"author": "multiformats",
"hash": "QmYeKnKpubCMRiq3PGZcTREErthbb5Q9cXsCoSkD9bjEBd",
"hash": "QmZyZDi491cCNTLfAhwcaDii2Kg4pwKRkhqQzURGDvY6ua",
"name": "go-multihash",
"version": "1.0.6"
"version": "1.0.7"
},
{
"author": "whyrusleeping",
Expand All @@ -32,10 +32,10 @@
"version": "0.1.0"
},
{
"author": "whyrusleeping",
"hash": "QmT8rehPR3F6bmwL6zjUN8XpiDBFFpMP2myPdC6ApsWfJf",
"name": "go-base58",
"version": "0.0.0"
"author": "mr-tron",
"hash": "QmWFAMPqsEyUX7gDUsRVmMWz59FxSpJ1b2v6bJ1yYzo7jY",
"name": "go-base58-fast",
"version": "0.1.1"
}
],
"gxVersion": "0.4.0",
Expand Down
6 changes: 3 additions & 3 deletions peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"strings"

logging "github.com/ipfs/go-log" // ID represents the identity of a peer.
b58 "github.com/jbenet/go-base58"
ic "github.com/libp2p/go-libp2p-crypto"
b58 "github.com/mr-tron/base58/base58"
mc "github.com/multiformats/go-multicodec-packed"
mh "github.com/multiformats/go-multihash"
)
Expand Down Expand Up @@ -171,7 +171,7 @@ func IDB58Encode(id ID) string {
return b58.Encode([]byte(id))
}

// IDHexDecode returns a b58-decoded Peer
// IDHexDecode returns a hex-decoded Peer
func IDHexDecode(s string) (ID, error) {
m, err := mh.FromHexString(s)
if err != nil {
Expand All @@ -180,7 +180,7 @@ func IDHexDecode(s string) (ID, error) {
return ID(m), err
}

// IDHexEncode returns b58-encoded string
// IDHexEncode returns hex-encoded string
func IDHexEncode(id ID) string {
return hex.EncodeToString([]byte(id))
}
Expand Down
2 changes: 1 addition & 1 deletion peer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
tu "github.com/libp2p/go-libp2p-peer/test"
mh "github.com/multiformats/go-multihash"

b58 "github.com/jbenet/go-base58"
b58 "github.com/mr-tron/base58/base58"
)

var gen1 keyset // generated
Expand Down