utils

package
v2.0.0-rc.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthKeyHash

func AuthKeyHash(key []byte) []byte

func GenerateMessageId

func GenerateMessageId() int64

GenerateMessageId essentially gives unix timestamp, but in a horribly specific way

Scheme of message_id (showed):

|1-31|32-61|62|63|
|A   |B    |C |D |

Where:

  • A: Approximately equal curent unix time
  • B: Any random unique 30-bit number
  • C: Indicates the message initiator: 0 — for client-initiated (request or server response), 1 — for server-initiated (notification or client response to server request).
  • D: message side (0 means client sent message, 1 means server did)

More info: https://core.telegram.org/mtproto/description#message-identifier-msg-id

func GenerateSessionID

func GenerateSessionID() uint64

func Sha1Byte

func Sha1Byte(input []byte) []byte

Types

type SyncIntObjectChan

type SyncIntObjectChan struct {
	// contains filtered or unexported fields
}

func NewSyncIntObjectChan

func NewSyncIntObjectChan() *SyncIntObjectChan

func (*SyncIntObjectChan) Add

func (s *SyncIntObjectChan) Add(key int, value chan tl.Object)

func (*SyncIntObjectChan) Delete

func (s *SyncIntObjectChan) Delete(key int) bool

func (*SyncIntObjectChan) Get

func (s *SyncIntObjectChan) Get(key int) (chan tl.Object, bool)

func (*SyncIntObjectChan) Has

func (s *SyncIntObjectChan) Has(key int) bool

func (*SyncIntObjectChan) Keys

func (s *SyncIntObjectChan) Keys() []int

type SyncIntReflectTypes

type SyncIntReflectTypes struct {
	// contains filtered or unexported fields
}

func NewSyncIntReflectTypes

func NewSyncIntReflectTypes() *SyncIntReflectTypes

func (*SyncIntReflectTypes) Add

func (s *SyncIntReflectTypes) Add(key int, value []reflect.Type)

func (*SyncIntReflectTypes) Delete

func (s *SyncIntReflectTypes) Delete(key int) bool

func (*SyncIntReflectTypes) Get

func (s *SyncIntReflectTypes) Get(key int) ([]reflect.Type, bool)

func (*SyncIntReflectTypes) Has

func (s *SyncIntReflectTypes) Has(key int) bool

func (*SyncIntReflectTypes) Keys

func (s *SyncIntReflectTypes) Keys() []int

type SyncSetInt

type SyncSetInt struct {
	// contains filtered or unexported fields
}

func NewSyncSetInt

func NewSyncSetInt() *SyncSetInt

func (*SyncSetInt) Add

func (s *SyncSetInt) Add(key int) bool

func (*SyncSetInt) Delete

func (s *SyncSetInt) Delete(key int) bool

func (*SyncSetInt) Has

func (s *SyncSetInt) Has(key int) bool

func (*SyncSetInt) Reset

func (s *SyncSetInt) Reset()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL