Skip to content

Commit b1b0b92

Browse files
committed
edit README
1 parent 797d80d commit b1b0b92

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ and vice versa,
2121
but their counterparts for binary formats
2222
are sorely missing from the package `encoding/binary`.
2323

24-
### Binary Formats
24+
## Binary Formats
2525
Message and file formats specify how bits are arranged to encode information.
2626
Control over individual bits or groups smaller than a byte is often required
2727
to put together and take apart these binary structures.
2828

29-
#### Message Formats
29+
### Message Formats
3030
Messages are the lifeblood of network applications.
3131
The following specifications
3232
quoted from [Section 3.1](https://datatracker.ietf.org/doc/html/rfc791#section-3.1)
@@ -101,7 +101,7 @@ but they make appropriate illustrations of binary message formats.
101101
Figure 3.
102102
```
103103

104-
#### File Formats
104+
### File Formats
105105
Binary file formats are not significantly different from message formats
106106
from an application developer's perspective.
107107
[RFC 1952](https://datatracker.ietf.org/doc/html/rfc1952)
@@ -340,9 +340,7 @@ func main() {
340340
```
341341

342342
Compare the first word (four bytes) in the output of `Marshal()`
343-
to the specifications for the first 32 bits of the Internet Header
344-
in [Section 3.1](https://datatracker.ietf.org/doc/html/rfc791#section-3.1)
345-
of RFC 791 defining the Internet Protocol.
343+
to the specifications for the first 32 bits of the Internet Header.
346344

347345
```
348346
0 1 2 3
@@ -376,9 +374,9 @@ of RFC 791 defining the Internet Protocol.
376374
high-reliability, and high-throughput.
377375
378376
Bits 0-2: Precedence.
379-
Bit 3: 0 = Normal Delay, 1 = Low Delay.
380-
Bits 4: 0 = Normal Throughput, 1 = High Throughput.
381-
Bits 5: 0 = Normal Relibility, 1 = High Relibility.
377+
Bit 3: 0 = Normal Delay, 1 = Low Delay.
378+
Bits 4: 0 = Normal Throughput, 1 = High Throughput.
379+
Bits 5: 0 = Normal Reliability, 1 = High Reliability.
382380
Bit 6-7: Reserved for Future Use.
383381
384382
0 1 2 3 4 5 6 7
@@ -407,7 +405,10 @@ of struct `demo.RFC791InternetHeaderFormatWithoutOptions`.
407405
Values of constants in the struct literal in the example code above
408406
are declared in the same file containing the struct definition.
409407

410-
### Performance
408+
## Performance and Optimisation
409+
This module has been optimised for performance.
410+
Suggestions to improve are welcome.
411+
411412
```bash
412413
pkg/encoding/binary$ go test -cpuprofile cpu.prof -memprofile mem.prof -bench . -benchmem
413414
```

0 commit comments

Comments
 (0)