github.com/yaling888/clash@v1.53.0/transport/header/wechat/wechat.go (about) 1 package wechat 2 3 import ( 4 "encoding/binary" 5 "math/rand/v2" 6 ) 7 8 type VideoChat struct { 9 sn uint32 10 } 11 12 func (vc *VideoChat) Size() int { 13 return 13 14 } 15 16 func (vc *VideoChat) Fill(b []byte) { 17 vc.sn++ 18 b[0] = 0xa1 19 b[1] = 0x08 20 binary.BigEndian.PutUint32(b[2:], vc.sn) 21 b[6] = 0x00 22 b[7] = 0x10 23 b[8] = 0x11 24 b[9] = 0x18 25 b[10] = 0x30 26 b[11] = 0x22 27 b[12] = 0x30 28 } 29 30 func New() *VideoChat { 31 return &VideoChat{ 32 sn: uint32(rand.Uint64() >> 40), 33 } 34 }