Add telegram api

This commit is contained in:
9seconds
2019-09-09 10:25:38 +03:00
parent 2918ed11e5
commit 3816dbf5b1
9 changed files with 203 additions and 26 deletions
+24
View File
@@ -0,0 +1,24 @@
package conntypes
import (
"crypto/rand"
"encoding/hex"
)
const ConnIDLength = 8
type ConnID [ConnIDLength]byte
func (c ConnID) String() string {
return hex.EncodeToString(c[:])
}
func NewConnID() ConnID {
var id ConnID
if _, err := rand.Read(id[:]); err != nil {
panic(err)
}
return id
}