-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add decode_len and decode_len_unsafe and update dependencies
- Loading branch information
1 parent
c94d001
commit 0b9407e
Showing
5 changed files
with
128 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
name = "varint-simd" | ||
version = "0.4.0" | ||
authors = ["Andrew Sun <[email protected]>"] | ||
edition = "2018" | ||
edition = "2021" | ||
license = "MIT OR Apache-2.0" | ||
description = "SIMD-accelerated varint encoder and decoder" | ||
repository = "https://github.com/as-com/varint-simd" | ||
|
@@ -23,14 +23,14 @@ native-optimizations = [] | |
dangerously-force-enable-pdep-since-i-really-know-what-im-doing = [] | ||
|
||
[dev-dependencies] | ||
criterion = "0.3" | ||
integer-encoding = "2.1" | ||
criterion = "0.5" | ||
integer-encoding = "4.0" | ||
rand = "0.8" | ||
bytes = "1" # prost-varint | ||
lazy_static = "1.4.0" | ||
|
||
[build-dependencies] | ||
rustc_version = "0.3.0" | ||
rustc_version = "0.4.0" | ||
|
||
[[bench]] | ||
name = "varint_bench" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#![no_main] | ||
use libfuzzer_sys::fuzz_target; | ||
|
||
use integer_encoding::VarInt; | ||
|
||
fuzz_target!(|data: [u8; 16]| { | ||
let reference = u64::decode_var(&data); | ||
|
||
let len = unsafe { varint_simd::decode_len_unsafe::<u64>(data.as_ptr()) }; | ||
|
||
if let Some(reference) = reference { | ||
assert_eq!(reference.1, len); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters