Highly-opinionated (ex-bullshit-free) MTPROTO proxy for Telegram. If you use v1.0 or upgrade broke you proxy, please read the chapter Version 2
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324
  1. package conntypes
  2. import (
  3. "crypto/rand"
  4. "encoding/hex"
  5. )
  6. const ConnIDLength = 8
  7. type ConnID [ConnIDLength]byte
  8. func (c ConnID) String() string {
  9. return hex.EncodeToString(c[:])
  10. }
  11. func NewConnID() ConnID {
  12. var id ConnID
  13. if _, err := rand.Read(id[:]); err != nil {
  14. panic(err)
  15. }
  16. return id
  17. }