Skip to content

Commit

Permalink
update project
Browse files Browse the repository at this point in the history
  • Loading branch information
magiclen committed Mar 5, 2022
1 parent 5eabe3d commit 1284869
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 205 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
toolchain: nightly
override: true
components: clippy
- run: cargo clippy -- -D warnings
- run: cargo clippy --all-targets --all-features -- -D warnings

tests:
strategy:
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "crc-any"
version = "2.4.1"
version = "2.4.2"
authors = ["Magic Len <len@magiclen.org>"]
edition = "2018"
edition = "2021"
repository = "https://github.com/magiclen/crc-any"
homepage = "https://magiclen.org/crc-any"
keywords = ["hash", "crc", "crc16", "crc32", "crc64"]
Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ To compute CRC values by providing the length of bits, expression, reflection, a
You can use `create_crc` associated function to create a CRC instance by providing the length of bits, expression, reflection, an initial value and a final xor value. For example, if you want to compute a CRC-24 value.

```rust
extern crate crc_any;

use crc_any::CRC;

let mut crc24 = CRC::create_crc(0x0000000000864CFB, 24, 0x0000000000B704CE, 0x0000000000000000, false);
Expand Down Expand Up @@ -113,8 +111,6 @@ To simplify the usage, there are several common versions of CRC whose computing
For instance,

```rust
extern crate crc_any;

use crc_any::CRC;

let mut crc64 = CRC::crc64();
Expand Down
18 changes: 10 additions & 8 deletions benches/bench.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
extern crate crc_any;

#[macro_use]
extern crate bencher;

use crc_any::CRC;

use bencher::Bencher;
use bencher::{benchmark_group, benchmark_main, Bencher};

fn crc8_construct(bencher: &mut Bencher) {
bencher.iter(|| CRC::create_crc(0x07, 8, 0x00, 0x00, false))
Expand All @@ -15,6 +10,7 @@ fn crc8_update_megabytes(bencher: &mut Bencher) {
let mut crc = CRC::crc8();
let mut bytes = Vec::with_capacity(1000000);

#[allow(clippy::uninit_vec)]
unsafe {
bytes.set_len(1000000);
}
Expand All @@ -34,6 +30,7 @@ fn crc12_update_megabytes(bencher: &mut Bencher) {
let mut crc = CRC::crc12();
let mut bytes = Vec::with_capacity(1000000);

#[allow(clippy::uninit_vec)]
unsafe {
bytes.set_len(1000000);
}
Expand All @@ -53,6 +50,7 @@ fn crc16_update_megabytes(bencher: &mut Bencher) {
let mut crc = CRC::crc16();
let mut bytes = Vec::with_capacity(1000000);

#[allow(clippy::uninit_vec)]
unsafe {
bytes.set_len(1000000);
}
Expand All @@ -65,13 +63,14 @@ fn crc16_update_megabytes(bencher: &mut Bencher) {
}

fn crc16_construct_wellknown(bencher: &mut Bencher) {
bencher.iter(|| crc_any::CRCu16::crc16ccitt_false())
bencher.iter(crc_any::CRCu16::crc16ccitt_false)
}

fn crc16_update_megabytes_wellknown(bencher: &mut Bencher) {
let mut crc = crc_any::CRCu16::crc16ccitt_false();
let mut bytes = Vec::with_capacity(1000000);

#[allow(clippy::uninit_vec)]
unsafe {
bytes.set_len(1000000);
}
Expand All @@ -91,6 +90,7 @@ fn crc32_update_megabytes(bencher: &mut Bencher) {
let mut crc = CRC::crc32();
let mut bytes = Vec::with_capacity(1000000);

#[allow(clippy::uninit_vec)]
unsafe {
bytes.set_len(1000000);
}
Expand All @@ -112,6 +112,7 @@ fn crc64_update_megabytes(bencher: &mut Bencher) {
let mut crc = CRC::crc64();
let mut bytes = Vec::with_capacity(1000000);

#[allow(clippy::uninit_vec)]
unsafe {
bytes.set_len(1000000);
}
Expand All @@ -124,13 +125,14 @@ fn crc64_update_megabytes(bencher: &mut Bencher) {
}

fn crc64_construct_wellknown(bencher: &mut Bencher) {
bencher.iter(|| crc_any::CRCu64::crc64iso())
bencher.iter(crc_any::CRCu64::crc64iso)
}

fn crc64_update_megabytes_wellknown(bencher: &mut Bencher) {
let mut crc = CRC::crc64();
let mut bytes = Vec::with_capacity(1000000);

#[allow(clippy::uninit_vec)]
unsafe {
bytes.set_len(1000000);
}
Expand Down
Loading

0 comments on commit 1284869

Please sign in to comment.