aboutsummaryrefslogtreecommitdiff
path: root/models/infohash.go
diff options
context:
space:
mode:
authorFelix Hanley <felix@userspace.com.au>2018-03-13 11:29:49 +0000
committerFelix Hanley <felix@userspace.com.au>2018-03-13 11:29:49 +0000
commit79c6a22d81e6ceadb23636e90e5d53f2a86e090d (patch)
tree33776c9bedc99ccd87c1c7061b6195500c05f54d /models/infohash.go
parenta67075e332458002ce4c56c0aa07e03807dc22ea (diff)
downloaddhtsearch-79c6a22d81e6ceadb23636e90e5d53f2a86e090d.tar.gz
dhtsearch-79c6a22d81e6ceadb23636e90e5d53f2a86e090d.tar.bz2
Fix tagging and announce callbacks
Diffstat (limited to 'models/infohash.go')
-rw-r--r--models/infohash.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/models/infohash.go b/models/infohash.go
index e8db422..bb1bd81 100644
--- a/models/infohash.go
+++ b/models/infohash.go
@@ -37,6 +37,11 @@ func InfohashFromString(s string) (*Infohash, error) {
func (ih Infohash) String() string {
return hex.EncodeToString(ih)
}
+
+func (ih Infohash) Bytes() []byte {
+ return []byte(ih)
+}
+
func (ih Infohash) Valid() bool {
// TODO
return len(ih) == 20