Files
netstack/tcpip/header/checksum_test.go
impact-eintr 7b3086540d wsl code edit
2022-11-30 11:31:44 +08:00

20 lines
317 B
Go

package header_test
import (
"log"
"math/rand"
"netstack/tcpip/header"
"testing"
"time"
)
func TestChecksum(t *testing.T) {
buf := make([]byte, 1024)
rand.Seed(time.Now().Unix())
for i := range buf {
buf[i] = uint8(rand.Intn(255))
}
sum := header.Checksum(buf, 0)
log.Println(sum)
}