aboutsummaryrefslogtreecommitdiffstats
path: root/whisper/whisperv6/topic.go
diff options
context:
space:
mode:
Diffstat (limited to 'whisper/whisperv6/topic.go')
-rw-r--r--whisper/whisperv6/topic.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/whisper/whisperv6/topic.go b/whisper/whisperv6/topic.go
index bf5da01e3..4dd8f283c 100644
--- a/whisper/whisperv6/topic.go
+++ b/whisper/whisperv6/topic.go
@@ -23,11 +23,13 @@ import (
"github.com/ethereum/go-ethereum/common/hexutil"
)
-// Topic represents a cryptographically secure, probabilistic partial
+// TopicType represents a cryptographically secure, probabilistic partial
// classifications of a message, determined as the first (left) 4 bytes of the
// SHA3 hash of some arbitrary data given by the original author of the message.
type TopicType [TopicLength]byte
+// BytesToTopic converts from the byte array representation of a topic
+// into the TopicType type.
func BytesToTopic(b []byte) (t TopicType) {
sz := TopicLength
if x := len(b); x < TopicLength {