Skip to content

Commit 7b3740f

Browse files
KillingSparkMoritz Borcherding
andauthored
use the new feature of the crc crate for more throughput in sctp (#569)
* use the new feature of the crc crate for more throughput in sctp * changelog entry --------- Co-authored-by: Moritz Borcherding <[email protected]>
1 parent ea3af36 commit 7b3740f

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

sctp/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Unreleased
44

5+
* Use the new algorithm in crc crate for better throughput [#569](https://github.com/webrtc-rs/webrtc/pull/569)
6+
57
## v0.8.0
68

79
* Fix 'attempt to add with overflow' panic in dev profile [#393](https://github.com/webrtc-rs/webrtc/pull/393)

sctp/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ tokio = { version = "1.32.0", features = [
2727
] }
2828
bytes = "1"
2929
rand = "0.8"
30-
crc = "3"
30+
crc = "3.2.1"
3131
async-trait = "0.1"
3232
log = "0.4"
3333
thiserror = "1"

sctp/src/util.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use bytes::Bytes;
2-
use crc::{Crc, CRC_32_ISCSI};
2+
use crc::{Crc, CRC_32_ISCSI, Table};
33

44
pub(crate) const PADDING_MULTIPLE: usize = 4;
55

@@ -11,7 +11,7 @@ pub(crate) fn get_padding_size(len: usize) -> usize {
1111
/// We need to use it for the checksum and don't want to allocate/clear each time.
1212
pub(crate) static FOUR_ZEROES: Bytes = Bytes::from_static(&[0, 0, 0, 0]);
1313

14-
pub(crate) const ISCSI_CRC: Crc<u32> = Crc::<u32>::new(&CRC_32_ISCSI);
14+
pub(crate) const ISCSI_CRC: Crc<u32, Table<16>> = Crc::<u32, Table<16>>::new(&CRC_32_ISCSI);
1515

1616
/// Fastest way to do a crc32 without allocating.
1717
pub(crate) fn generate_packet_checksum(raw: &Bytes) -> u32 {

0 commit comments

Comments
 (0)