1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 19:17:38 +08:00
MiraiGo/internal/tlv/t188.go
源文雨 3e84f279c1
fix: use general write at method (#225)
* fix: use general write at method

* fix: drop WriteShortBufLenExcludeSelfAfterPos
2021-12-23 22:09:04 +08:00

18 lines
300 B
Go

package tlv
import (
"crypto/md5"
"github.com/Mrs4s/MiraiGo/binary"
)
func T188(androidId []byte) []byte {
return binary.NewWriterF(func(w *binary.Writer) {
w.WriteUInt16(0x188)
pos := w.FillUInt16()
h := md5.Sum(androidId)
w.Write(h[:])
w.WriteUInt16At(pos, uint16(w.Len()-4))
})
}