Skip to content

Commit c29f141

Browse files
committed
Merge branch 'master' of https://github.com/snksoft/crc
2 parents ee26f30 + b1d83c9 commit c29f141

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
src [![GoDoc](https://godoc.org/github.com/snksoft/src?status.png)](https://godoc.org/github.com/snksoft/crc)
1+
crc [![GoDoc](https://godoc.org/github.com/snksoft/src?status.png)](https://godoc.org/github.com/snksoft/crc)
22
========
33
This package implements generic CRC calculations up to 64 bits wide.
44
It aims to be fairly fast and fairly complete, allowing users to match pretty much
@@ -17,7 +17,7 @@ go get github.com/snksoft/crc
1717

1818
## Usage
1919

20-
Using src is easy. Here is an example of calculating CCITT crc.
20+
Using `crc` is easy. Here is an example of calculating a CCITT crc.
2121
```go
2222
package main
2323

@@ -33,7 +33,8 @@ func main() {
3333
}
3434
```
3535

36-
For larger data, table driven implementation is faster. Here is how to use it. Note that crc.Hash impements hash.Hash interface, so you can use it instead if you want.
36+
For larger data, table driven implementation is faster. Note that `crc.Hash` implements `hash.Hash` interface, so you can use it instead if you want.
37+
Here is how to use it:
3738
```go
3839
package main
3940

@@ -58,13 +59,13 @@ func main() {
5859
}
5960
```
6061
## Notes
61-
Beware that Hash instance is not thread safe. If you want to do parallel CRC calculations, then either use NewHash() to create multiple Hash instances or simply make a copy of Hash whehever you need it. Latter option avoids recalculating CRC table, but keep in mind that NewHash() returns a pointer, so simple assignement will point to the same instance.
62-
Use either
62+
Beware that Hash instance is not thread safe. If you want to do parallel CRC calculations, then either use `NewHash()` to create multiple Hash instances or simply make a copy of Hash whehever you need it. Latter option avoids recalculating CRC table, but keep in mind that `NewHash()` returns a pointer, so simple assignement will point to the same instance.
63+
Use either
6364
```go
64-
hash2 := &crc.Hash{}
65-
*hash2 = *hash
65+
hash2 := &crc.Hash{}
66+
*hash2 = *hash
6667
```
67-
or simply
68+
or simply
6869
```go
69-
var hash2 = *hash
70+
var hash2 = *hash
7071
```

0 commit comments

Comments
 (0)