...
Source file
src/net/netip/leaf_alts.go
1
2
3
4
5
6
7
8 package netip
9
10 func beUint64(b []byte) uint64 {
11 _ = b[7]
12 return uint64(b[7]) | uint64(b[6])<<8 | uint64(b[5])<<16 | uint64(b[4])<<24 |
13 uint64(b[3])<<32 | uint64(b[2])<<40 | uint64(b[1])<<48 | uint64(b[0])<<56
14 }
15
16 func bePutUint64(b []byte, v uint64) {
17 _ = b[7]
18 b[0] = byte(v >> 56)
19 b[1] = byte(v >> 48)
20 b[2] = byte(v >> 40)
21 b[3] = byte(v >> 32)
22 b[4] = byte(v >> 24)
23 b[5] = byte(v >> 16)
24 b[6] = byte(v >> 8)
25 b[7] = byte(v)
26 }
27
28 func bePutUint32(b []byte, v uint32) {
29 _ = b[3]
30 b[0] = byte(v >> 24)
31 b[1] = byte(v >> 16)
32 b[2] = byte(v >> 8)
33 b[3] = byte(v)
34 }
35
36 func leUint16(b []byte) uint16 {
37 _ = b[1]
38 return uint16(b[0]) | uint16(b[1])<<8
39 }
40
41 func lePutUint16(b []byte, v uint16) {
42 _ = b[1]
43 b[0] = byte(v)
44 b[1] = byte(v >> 8)
45 }
46
View as plain text