crc/README.md

36 lines
1.1 KiB
Markdown
Raw Permalink Normal View History

2016-09-22 20:31:24 -07:00
# CRC
CRC is a simple command-line utility to compute various CRC values for one or
more files.
It supports three CRC algorithms (selected via `--mode=<alg>`):
2018-03-04 19:35:58 -08:00
* `crc64-ecma` uses the [ECMA polynomial](https://godoc.org/hash/crc64#pkg-constants) to compute a 64-bit CRC.
2016-09-22 20:31:24 -07:00
* `crc64-iso` uses the [ISO polynomial](https://godoc.org/hash/crc64#pkg-constants) to compute a 64-bit CRC.
2018-03-04 19:35:58 -08:00
* `crc32` (*default*) uses the [IEEE polynomial](https://godoc.org/hash/crc32#pkg-constants) to compute a 32-bit CRC. This is equivalent to the `crc32` linux binary.
2016-09-22 20:31:24 -07:00
If only a single file is specified on the command line, then only the hexadecimal hash is printed. If more than one file is specified, the output will be
```
<hash><tab><filename>
```
for each file.
## Installation
```bash
go get github.com/augustoroman/crc
```
## Usage
```bash
2018-03-04 19:35:58 -08:00
# Compute the default hash (crc32 w/ IEEE polynomial) of one or more files.
2016-09-22 20:31:24 -07:00
crc <file> [<file> ...]
# Compute the crc64 hash with ISO polynomial.
crc --mode=crc64-iso <file> [<file> ...]
2018-03-04 19:35:58 -08:00
# Compute the crc64 hash (with the ECMA polynomial).
crc --mode=crc64-ecma <file> [<file> ...]
2016-09-22 20:31:24 -07:00
```
## License
This is released under the MIT license