Added support for no_std.

This commit is contained in:
Alienscience 2022-01-30 11:32:52 +01:00
parent c9d3084622
commit 526253626d
4 changed files with 17 additions and 1 deletions

View file

@ -21,3 +21,4 @@ run-check:
- rustc --version && cargo --version
- cargo test
- cargo clippy -- --deny warnings
- cargo build --no-default-features

View file

@ -11,7 +11,7 @@ keywords = ["hash", "rolling", "decomposable"]
categories = ["algorithms"]
[dependencies]
num-traits = "0.2"
num-traits = { version = "0.2", default-features = false }
[dev-dependencies]
quickcheck = "1"
@ -23,3 +23,7 @@ easybench = "1"
[[bench]]
name = "bench"
harness = false
[features]
default = ["std", "num-traits/std"]
std = []

View file

@ -78,3 +78,13 @@ This will output the number of collisions.
| Random Number Generator | 118 |
| Cyclic Poly 32bit | 140 |
| Adler32 | 2872 |
# Cargo Features
## std
By default, this crate uses the Rust standard library enabled with the feature `std` . The crate supports `no_std` if it is included as a dependency without default features e.g.:
```toml
cyclic-poly-23 = { version = "xxx", default-features = false }
```

View file

@ -1,5 +1,6 @@
#![forbid(unsafe_code)]
#![forbid(missing_docs)]
#![cfg_attr(not(any(feature = "std", test)), no_std)]
//! A recursive/rolling/decomposable hash using cyclic polynomials.
//! This crate is an implementation of the algorithm given in Section 2.3