forked from awesomized/crc-fast-rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCargo.toml
More file actions
107 lines (89 loc) · 3.55 KB
/
Cargo.toml
File metadata and controls
107 lines (89 loc) · 3.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
[package]
name = "crc-fast"
version = "1.8.1"
edition = "2021"
authors = ["Don MacAskill"]
license = "MIT OR Apache-2.0"
keywords = ["crc", "checksum", "simd", "accelerated", "fast"]
categories = ["algorithms", "encoding", "hardware-support"]
repository = "https://github.com/awesomized/crc-fast-rust"
description = "World's fastest generic CRC32 and CRC64 calculator using SIMD. Supplies a C-compatible shared library for use in other languages."
readme = "README.md"
# important intrinsics stabilization notes:
# 1.69.0 added VPCLMULQDQ x86 detection support
# 1.70.0 added LLVM 16 which supports PMULL2 on Aarch64
# 1.89.0 stabilized AVX-512 intrinsics, including VPCLMULQDQ
rust-version = "1.81"
[lib]
name = "crc_fast"
crate-type = ["lib", "cdylib", "staticlib"]
bench = true
[dependencies]
crc = "3"
# We use digest with default-features = false and features = ["alloc"] to enable heap allocation support in no_std environments.
# This configuration is safe because the alloc feature in digest does not depend on its default features as of digest v0.10.
digest = { version = "0.10", optional = true, default-features = false, features = ["alloc"] }
# will be removed once Rust 1.89 is the minimum supported version
rustversion = "1.0"
# constrain indexmap (transitive) to a version compatible with Rust 1.81.0
indexmap = { version = ">=2.11.0, <2.12.0", optional = true }
# no_std support
# spin is always required for no_std builds (feature detection synchronization)
spin = { version = "0.10.0", default-features = false, features = ["once", "rwlock", "mutex", "spin_mutex"] }
# hashbrown is only needed when caching is enabled in no_std
hashbrown = { version = "0.16.0", optional = true }
[dev-dependencies]
criterion = "0.7"
cbindgen = "0.29"
rand = "0.9"
regex = "1.12"
wasm-bindgen-test = "0.3"
# lto=true has a big improvement in performance
[profile.release]
lto = true
strip = true
codegen-units = 1
opt-level = 3
[[bin]]
name = "checksum"
path = "src/bin/checksum.rs"
required-features = ["cli"]
[[bin]]
name = "arch-check"
path = "src/bin/arch-check.rs"
required-features = ["cli"]
[[bin]]
name = "get-custom-params"
path = "src/bin/get-custom-params.rs"
required-features = ["cli"]
[[bench]]
name = "benchmark"
harness = false
required-features = ["std"]
[features]
# default features
default = ["std", "panic-handler", "ffi"]
std = ["alloc"] # std implies alloc is available
alloc = ["digest"] # marker feature for heap allocation support
panic-handler = [] # Provides panic handler for no_std library checks (disable in binaries)
ffi = [] # C/C++ compatible dynamic/static library, planned to become optional in the next MAJOR version (v2) to reduce overhead
# optional features
cli = ["std"] # command line interface binaries (checksum, arch-check, get-custom-params)
cache = ["alloc", "hashbrown"] # no_std caching requires alloc + hashbrown HashMap
# the features below are deprecated, aren't in use, and will be removed in the next MAJOR version (v2)
vpclmulqdq = [] # deprecated, VPCLMULQDQ stabilized in Rust 1.89.0
optimize_crc32_auto = [] # deprecated
optimize_crc32_neon_eor3_v9s3x2e_s3 = [] # deprecated
optimize_crc32_neon_v12e_v1 = [] # deprecated
optimize_crc32_neon_v3s4x2e_v2 = [] # deprecated
optimize_crc32_neon_blended = [] # deprecated
optimize_crc32_avx512_vpclmulqdq_v3x2 = [] # deprecated
optimize_crc32_avx512_v4s3x3 = [] # deprecated
optimize_crc32_sse_v4s3x3 = [] # deprecated
[package.metadata.docs.rs]
features = ["std"]
rustdoc-args = ["--cfg", "docsrs"]
[[test]]
name = "checksum_integration_tests"
path = "tests/checksum_integration_tests.rs"
required-features = ["cli"]