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
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

cache.go 558B

1234567891011121314151617181920212223242526
  1. package antireplay
  2. import "github.com/allegro/bigcache"
  3. type cache struct {
  4. obfuscated2 *bigcache.BigCache
  5. tls *bigcache.BigCache
  6. }
  7. func (c *cache) AddObfuscated2(data []byte) {
  8. c.obfuscated2.Set(string(data), nil) // nolint: errcheck
  9. }
  10. func (c *cache) AddTLS(data []byte) {
  11. c.tls.Set(string(data), nil) // nolint: errcheck
  12. }
  13. func (c *cache) HasObfuscated2(data []byte) bool {
  14. _, err := c.obfuscated2.Get(string(data))
  15. return err == nil
  16. }
  17. func (c *cache) HasTLS(data []byte) bool {
  18. _, err := c.tls.Get(string(data))
  19. return err == nil
  20. }