@@ -49,6 +49,51 @@ the local system. Specifying the `DESTDIR` environment variable will allow you t
4949DESTDIR=/my/custom/path make install
5050```
5151
52+ ## Features
53+
54+ The library supports various feature flags for different environments:
55+
56+ * ` std ` (default) - Standard library support, includes ` alloc `
57+ * ` alloc ` - Heap allocation support (enables ` Digest ` trait, custom CRC params, checksum combining)
58+ * ` cache ` - Caches generated constants for custom CRC parameters (requires ` alloc ` )
59+ * ` cli ` - Enables command-line tools (` checksum ` , ` arch-check ` , ` get-custom-params ` )
60+ * ` ffi ` - C/C++ FFI bindings for shared library
61+ * ` panic-handler ` - Provides panic handler for ` no_std ` environments (disable when building binaries)
62+
63+ ### Building for no_std
64+
65+ For embedded targets without standard library:
66+
67+ ``` bash
68+ # Minimal no_std (core CRC only, no heap)
69+ cargo build --target thumbv7em-none-eabihf --no-default-features --lib
70+
71+ # With heap allocation (enables Digest, custom params)
72+ cargo build --target thumbv7em-none-eabihf --no-default-features --features alloc --lib
73+
74+ # With caching (requires alloc)
75+ cargo build --target thumbv7em-none-eabihf --no-default-features --features cache --lib
76+ ```
77+
78+ Tested on ARM Cortex-M (` thumbv7em-none-eabihf ` , ` thumbv8m.main-none-eabihf ` ) and RISC-V (` riscv32imac-unknown-none-elf ` ).
79+
80+ ### Building for WASM
81+
82+ For WebAssembly targets:
83+
84+ ``` bash
85+ # Minimal WASM
86+ cargo build --target wasm32-unknown-unknown --no-default-features --lib
87+
88+ # With heap allocation (typical use case)
89+ cargo build --target wasm32-unknown-unknown --no-default-features --features alloc --lib
90+
91+ # Using wasm-pack for browser
92+ wasm-pack build --target web --no-default-features --features alloc
93+ ```
94+
95+ Tested on ` wasm32-unknown-unknown ` , ` wasm32-wasip1 ` , and ` wasm32-wasip2 ` targets.
96+
5297## Usage
5398
5499Add ` crc-fast = version = "1.5" ` to your ` Cargo.toml ` dependencies, which will enable every available optimization for
0 commit comments