Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(crc): add crc hash fn #1136

Merged
merged 8 commits into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ stdlib = [
"dep:convert_case",
"dep:cidr-utils",
"dep:community-id",
"dep:crc",
"dep:crypto_secretbox",
"dep:csv",
"dep:ctr",
Expand Down Expand Up @@ -135,6 +136,7 @@ csv = { version = "1", optional = true }
clap = { version = "4", features = ["derive"], optional = true }
codespan-reporting = { version = "0.11", optional = true }
convert_case = { version = "0.6.0", optional = true }
crc = { version = "3.2.1", optional = true }
data-encoding = { version = "2", optional = true }
digest = { version = "0.10", optional = true }
dyn-clone = { version = "1", default-features = false, optional = true }
Expand Down
2 changes: 2 additions & 0 deletions LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ convert_case,https://github.com/rutrum/convert-case,MIT,David Purdum <purdum41@g
convert_case,https://github.com/rutrum/convert-case,MIT,Rutrum <dave@rutrum.net>
core-foundation,https://github.com/servo/core-foundation-rs,MIT OR Apache-2.0,The Servo Project Developers
cpufeatures,https://github.com/RustCrypto/utils,MIT OR Apache-2.0,RustCrypto Developers
crc,https://github.com/mrhooray/crc-rs,MIT OR Apache-2.0,"Rui Hu <code@mrhooray.com>, Akhil Velagapudi <4@4khil.com>"
crc-catalog,https://github.com/akhilles/crc-catalog,MIT OR Apache-2.0,Akhil Velagapudi <akhilvelagapudi@gmail.com>
crc32fast,https://github.com/srijs/rust-crc32fast,MIT OR Apache-2.0,"Sam Rijs <srijs@airpost.net>, Alex Crichton <alex@alexcrichton.com>"
crossbeam-channel,https://github.com/crossbeam-rs/crossbeam,MIT OR Apache-2.0,The crossbeam-channel Authors
crossbeam-epoch,https://github.com/crossbeam-rs/crossbeam,MIT OR Apache-2.0,The crossbeam-epoch Authors
Expand Down
10 changes: 10 additions & 0 deletions benches/stdlib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ criterion_group!(
community_id,
compact,
contains,
crc,
decode_base16,
decode_base64,
decode_charset,
Expand Down Expand Up @@ -290,6 +291,15 @@ bench_function! {
}
}

bench_function! {
crc => vrl::stdlib::Crc;

literal {
args: func_args![value: "foo"],
want: Ok(b"2356372769"),
}
}

bench_function! {
decode_base16 => vrl::stdlib::DecodeBase16;

Expand Down
3 changes: 3 additions & 0 deletions changelog.d/1136.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Added new `crc` function to calculate CRC (Cyclic Redundancy Check) checksum

authors: ivor11
Loading
Loading