Skip to content

Commit

Permalink
Add a hex print string method for InfoHashes
Browse files Browse the repository at this point in the history
  • Loading branch information
nictuku committed Aug 30, 2016
1 parent 6ea2892 commit b0d0998
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions krpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,10 @@ func newTransactionId() int {

type InfoHash string

func (i InfoHash) String() string {
return fmt.Sprintf("%x", i)
}

// DecodeInfoHash transforms a hex-encoded 20-characters string to a binary
// infohash.
func DecodeInfoHash(x string) (b InfoHash, err error) {
Expand Down

0 comments on commit b0d0998

Please sign in to comment.