Esempio n. 1
0
func (vc *VideoChat) Write(b []byte) (int, error) {
	vc.sn++
	b = append(b[:0], 0xa1, 0x08)
	b = serial.IntToBytes(vc.sn, b)
	b = append(b, 0x10, 0x11, 0x18, 0x30, 0x22, 0x30)
	return 13, nil
}
Esempio n. 2
0
func ChunkKeyGenerator(iv []byte) func() []byte {
	chunkId := 0
	return func() []byte {
		newKey := make([]byte, 0, len(iv)+4)
		newKey = append(newKey, iv...)
		newKey = serial.IntToBytes(chunkId, newKey)
		chunkId++
		return newKey
	}
}