Skip to content

Commit 50c6847

Browse files
committed
Update README
1 parent 0704866 commit 50c6847

File tree

1 file changed

+28
-11
lines changed

1 file changed

+28
-11
lines changed

README.md

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,27 @@ See [CHANGELOG](CHANGELOG.md).
3838

3939
## Build & Install
4040

41-
`cargo build` will obviously build the library, including
42-
the [C-compatible library](#cc-compatible-library).
41+
### Library
4342

44-
A _very_ basic [Makefile](Makefile) is supplied which supports `make install` to install the shared library and header
45-
file to
46-
the local system. Specifying the `DESTDIR` environment variable will allow you to customize the install location.
43+
`cargo build --release` will obviously build the Rust library, including the [C/C++ compatible dynamic and static libraries](#cc-compatible-library).
44+
45+
### CLI tools
46+
47+
There are some command-line tools available:
48+
49+
- `checksum` calculates CRC checksums from the supplied string or file
50+
- `get-custom-params` generates the custom CRC parameters for the supplied Rocksoft model values
51+
- `arch-check` checks the current architecture's hardware acceleration features (primarily for debugging)
52+
53+
To build them, enable the `cli` feature: `cargo build --features cli --release`.
54+
55+
### Everything
56+
57+
To build the libraries and the CLI tools, use the `--all-features` flag: `cargo build --all-features --release`.
58+
59+
A _very_ basic [Makefile](Makefile) is supplied which supports `make install` to install the libraries, header file, and
60+
CLI binaries to the local system. Specifying the `DESTDIR` environment variable will allow you to customize the install
61+
location.
4762

4863
```
4964
DESTDIR=/my/custom/path make install
@@ -60,7 +75,7 @@ The library supports various feature flags for different environments:
6075
* `ffi` - C/C++ FFI bindings for shared library
6176
* `panic-handler` - Provides panic handler for `no_std` environments (disable when building binaries)
6277

63-
### Building for no_std
78+
### Building for `no_std`
6479

6580
For embedded targets without standard library:
6681

@@ -75,9 +90,10 @@ cargo build --target thumbv7em-none-eabihf --no-default-features --features allo
7590
cargo build --target thumbv7em-none-eabihf --no-default-features --features cache --lib
7691
```
7792

78-
Tested on ARM Cortex-M (`thumbv7em-none-eabihf`, `thumbv8m.main-none-eabihf`) and RISC-V (`riscv32imac-unknown-none-elf`).
93+
Tested on ARM Cortex-M (`thumbv7em-none-eabihf`, `thumbv8m.main-none-eabihf`) and RISC-V (
94+
`riscv32imac-unknown-none-elf`).
7995

80-
### Building for WASM
96+
### Building for `WASM`
8197

8298
For WebAssembly targets:
8399

@@ -96,7 +112,7 @@ Tested on `wasm32-unknown-unknown`, `wasm32-wasip1`, and `wasm32-wasip2` targets
96112

97113
## Usage
98114

99-
Add `crc-fast = version = "1.5"` to your `Cargo.toml` dependencies, which will enable every available optimization for
115+
Add `crc-fast = version = "1"` to your `Cargo.toml` dependencies, which will enable every available optimization for
100116
the `stable` toolchain.
101117

102118
### Digest
@@ -294,7 +310,8 @@ assert_eq!(checksum.unwrap(), 0xcbf43926);
294310

295311
`cargo build` will produce a shared library target (`.so` on Linux, `.dll` on Windows, `.dylib` on macOS, etc) and an
296312
auto-generated [libcrc_fast.h](libcrc_fast.h) header file for use in non-Rust projects, such as through
297-
[FFI](https://en.wikipedia.org/wiki/Foreign_function_interface). It will also produce a static library target (`.a` on Linux and macOS, `.lib` on Windows, etc) for projects
313+
[FFI](https://en.wikipedia.org/wiki/Foreign_function_interface). It will also produce a static library target (`.a` on
314+
Linux and macOS, `.lib` on Windows, etc) for projects
298315
which prefer statically linking.
299316

300317
There is a [crc-fast PHP extension](https://github.com/awesomized/crc-fast-php-ext) using it, for example.
@@ -355,7 +372,7 @@ but all known public & private implementations agree on the correct value, which
355372
# Acceleration targets
356373

357374
This library has baseline support for accelerating all known `CRC-32` and `CRC-64` variants on `aarch64`, `x86_64`, and
358-
`x86` internally in pure `Rust`.
375+
`x86` internally in pure `Rust`.
359376

360377
### Checking your platform capabilities
361378

0 commit comments

Comments
 (0)