commit_hash stringlengths 40 40 | author stringlengths 1 57 | date timestamp[s]date 2010-07-26 04:45:09 2026-04-14 18:21:10 | message stringlengths 8 1.39M | diff stringlengths 68 51.2k | files_changed int64 1 136 | insertions int64 0 2.35k | deletions int64 0 1.9k |
|---|---|---|---|---|---|---|---|
1008365593747fd905ad7377b8422de4b6d1c68e | Alexander Nemish | 2017-12-13T18:15:11 | Derive Debug for CoreId and make CoreId.id field public.
Derive Debug for CoreId and make CoreId.id field public. | diff --git a/src/lib.rs b/src/lib.rs
index c23a50c..0ab172a 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -49,9 +49,9 @@ pub fn set_for_current(core_id: CoreId) {
}
/// This represents a CPU core.
-#[derive(Copy, Clone)]
+#[derive(Copy, Clone, Debug)]
pub struct CoreId {
- id: usize,
+ pub id: usize,
}
// ... | 1 | 2 | 2 |
b8b2ccaab275147ee73bb37b697a567bfeeda854 | Philip Woods | 2017-10-10T19:49:29 | Fixed another stupid error in the Windows code | diff --git a/src/lib.rs b/src/lib.rs
index a72e429..c23a50c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -251,11 +251,11 @@ mod windows {
fn get_affinity_mask() -> Option<u64> {
#[cfg(target_pointer_width = "64")]
let mut process_mask: u64 = 0;
- #[cfg(target_pointer_width = "64")]
+ ... | 1 | 2 | 2 |
e057cfac67fe48411300df3c18aae40370f546ce | Philip Woods | 2017-10-10T19:46:20 | Hopefully fixed size issues this time | diff --git a/src/lib.rs b/src/lib.rs
index 04d0a42..a72e429 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -237,7 +237,7 @@ mod windows {
pub fn set_for_current(core_id: CoreId) {
// Convert `CoreId` back into mask.
- let mask: usize = 1 << core_id.id;
+ let mask: u64 = 1 << core_id.id;
... | 1 | 10 | 4 |
e9dd643c28e70c3a7571ea171e67b88871d25eea | Philip Woods | 2017-10-10T19:36:53 | Hopefully fixed build error on 32-bit Windows | diff --git a/src/lib.rs b/src/lib.rs
index 14f8e13..04d0a42 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -237,7 +237,7 @@ mod windows {
pub fn set_for_current(core_id: CoreId) {
// Convert `CoreId` back into mask.
- let mask: u64 = 1 << core_id.id;
+ let mask: usize = 1 << core_id.id;
... | 1 | 3 | 3 |
25da5bceebf8ccdeef9a9a8b1de0285f0fb58981 | Philip Woods | 2017-09-29T22:49:38 | Fixed weird git tag issue | diff --git a/Cargo.toml b/Cargo.toml
index 1214f2e..3f2b4cb 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "core_affinity"
-version = "0.5.7"
+version = "0.5.8"
authors = ["Philip Woods <elzairthesorcerer@gmail.com>"]
description = "Manages CPU affinities"
readme = "README.md" | 1 | 1 | 1 |
ebb63629dbaf35605cd25ae5da801abdae317094 | Philip Woods | 2017-09-29T22:47:57 | Bumped version number | diff --git a/Cargo.toml b/Cargo.toml
index cdf95e4..1214f2e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "core_affinity"
-version = "0.5.6"
+version = "0.5.7"
authors = ["Philip Woods <elzairthesorcerer@gmail.com>"]
description = "Manages CPU affinities"
readme = "README.md"
diff --git... | 2 | 4 | 2 |
9e537cc95e7e9b33eb510222d6322606da3aa171 | Philip Woods | 2017-09-29T21:07:53 | Hopefully fixed the OSX build error | diff --git a/src/lib.rs b/src/lib.rs
index a5af9c2..6998241 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -336,7 +336,6 @@ mod macos {
type thread_policy_t = *mut thread_affinity_policy_data_t;
const THREAD_AFFINITY_POLICY: thread_policy_flavor_t = 4;
- static THREAD_AFFINITY_POLICY_COUNT: mach_msg_type_nu... | 1 | 2 | 1 |
865a9b9b18376c450cf555b7999458da09a5fb83 | Philip Woods | 2017-09-29T15:23:56 | Fixed type in MacOS section | diff --git a/src/lib.rs b/src/lib.rs
index ed3cf23..93126f2 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -324,6 +324,7 @@ mod macos {
type kern_return_t = c_int;
type integer_t = c_int;
type natural_t = c_uint;
+ type thread_t = c_uint;
type thread_policy_flavor_t = natural_t;
type mach_msg_t... | 1 | 5 | 4 |
d619947268589d4259dc7375948b91270b3fcebd | Philip Woods | 2017-09-29T14:34:18 | Fixed MacOS build errors | diff --git a/Cargo.toml b/Cargo.toml
index e727025..214e638 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "core_affinity"
-version = "0.5.5"
+version = "0.5.6"
authors = ["Philip Woods <elzairthesorcerer@gmail.com>"]
description = "Manages CPU affinities"
readme = "README.md"
@@ -12,11 ... | 2 | 15 | 13 |
89caef1446eb22b6c23d3f8dcf9f9a574a9d5644 | Philip Woods | 2017-09-29T00:05:06 | Cleaned up Windows section | diff --git a/Cargo.toml b/Cargo.toml
index 3f53eea..e727025 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "core_affinity"
-version = "0.5.4"
+version = "0.5.5"
authors = ["Philip Woods <elzairthesorcerer@gmail.com>"]
description = "Manages CPU affinities"
readme = "README.md"
diff --git... | 2 | 6 | 8 |
bfe88b39d434c4c54352f51cccb91c832401c439 | Philip Woods | 2017-09-28T23:31:39 | Fixed another Windows build error | diff --git a/Cargo.toml b/Cargo.toml
index c0e2e17..3f53eea 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "core_affinity"
-version = "0.5.3"
+version = "0.5.4"
authors = ["Philip Woods <elzairthesorcerer@gmail.com>"]
description = "Manages CPU affinities"
readme = "README.md"
diff --git... | 2 | 3 | 3 |
a08564604b0036580d7ba4b86dae82e6c5fc5a2f | Philip Woods | 2017-09-28T23:16:55 | Fixed build errors for MacOS and Windows | diff --git a/Cargo.toml b/Cargo.toml
index 3ed6c28..c0e2e17 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "core_affinity"
-version = "0.5.2"
+version = "0.5.3"
authors = ["Philip Woods <elzairthesorcerer@gmail.com>"]
description = "Manages CPU affinities"
readme = "README.md"
@@ -18,4 +... | 2 | 76 | 43 |
cd1bdf2dd5ef6cc0104da1837b1f1a4e9cd34928 | Philip Woods | 2017-09-15T14:35:58 | Fixed toplevel documentation so it shows up in docs | diff --git a/Cargo.toml b/Cargo.toml
index 0cb970a..d264100 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "core_affinity"
-version = "0.4.1"
+version = "0.4.2"
authors = ["Philip Woods <elzairthesorcerer@gmail.com>"]
description = "Manages CPU affinities"
readme = "README.md"
diff --git... | 2 | 28 | 28 |
1b56c7e6f1905ce57f791947f4400a58c011d960 | Philip Woods | 2017-09-15T14:33:46 | Changed invalid category slug | diff --git a/Cargo.toml b/Cargo.toml
index 93cff91..0cb970a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "core_affinity"
-version = "0.4.0"
+version = "0.4.1"
authors = ["Philip Woods <elzairthesorcerer@gmail.com>"]
description = "Manages CPU affinities"
readme = "README.md"
@@ -9,7 +9... | 1 | 2 | 2 |
749622d9e1918e7858efec5ff4c765de92112311 | Philip Woods | 2017-09-15T14:30:43 | Added "support" for unsupported platforms | diff --git a/Cargo.toml b/Cargo.toml
index 5b53102..93cff91 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,13 +1,23 @@
[package]
name = "core_affinity"
-version = "0.3.0"
+version = "0.4.0"
authors = ["Philip Woods <elzairthesorcerer@gmail.com>"]
+description = "Manages CPU affinities"
+readme = "README.md"
+license... | 2 | 24 | 2 |
946eaa143549a013b8065f83eedcb45cc2fde38e | Philip Woods | 2017-09-14T23:07:36 | Added some simple documentation | diff --git a/src/lib.rs b/src/lib.rs
index b5711b4..c0b0477 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -2,14 +2,23 @@
#[cfg(test)]
extern crate num_cpus;
+/// This function tries to retrieve information
+/// on all the "cores" active on this system.
pub fn get_core_ids() -> Option<Vec<CoreId>> {
get_core_ids... | 1 | 9 | 0 |
8a1be9adbe8ec3dc5d54c5bdab8abfd5c2aa06d4 | Philip Woods | 2017-09-14T23:03:39 | Got default toplevel methods | diff --git a/src/lib.rs b/src/lib.rs
index f3b1349..b5711b4 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -2,22 +2,12 @@
#[cfg(test)]
extern crate num_cpus;
-#[cfg(target_os = "linux")]
pub fn get_core_ids() -> Option<Vec<CoreId>> {
- linux::get_core_ids()
-}
-#[cfg(target_os = "windows")]
-pub fn get_core_ids() ... | 1 | 26 | 12 |
d11d9c5438ea7b0c77a1124d02a3c410b685fe2b | Philip Woods | 2017-09-14T17:00:28 | Added main functions for Windows | diff --git a/src/lib.rs b/src/lib.rs
index 10cc54d..f3b1349 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -2,15 +2,23 @@
#[cfg(test)]
extern crate num_cpus;
+#[cfg(target_os = "linux")]
pub fn get_core_ids() -> Option<Vec<CoreId>> {
- #[cfg(target_os = "linux")]
linux::get_core_ids()
}
+#[cfg(target_os = "w... | 1 | 10 | 2 |
a755c4c37efcf1a053b25d5944bdea667282addd | Philip Woods | 2017-09-14T16:52:30 | Began adding windows support | diff --git a/Cargo.toml b/Cargo.toml
index 29d9e24..c22c0ca 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "core_affinity"
-version = "0.1.0"
+version = "0.2.0"
authors = ["Philip Woods <elzairthesorcerer@gmail.com>"]
[dependencies]
@@ -8,5 +8,8 @@ authors = ["Philip Woods <elzairthesor... | 2 | 182 | 96 |
436f263b30b54f8b2c5ceeccd52eb0756f97aa24 | DoumanAsh | 2025-09-17T01:18:00 | Update getrandom | diff --git a/Cargo.toml b/Cargo.toml
index 75d7b7b..8aa98ff 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -30,7 +30,7 @@ xxh3 = [] # Enable xxh3 implementation
const_xxh3 = [] # Enable const xxh3 implementation
[dev-dependencies]
-getrandom = "0.2"
+getrandom = "0.3"
xxhash-c-sys = "0.8.6"
[package.metadata.docs.... | 3 | 10 | 10 |
7026cd705195f502283f97aafc9ea41930099c68 | DoumanAsh | 2024-12-30T00:30:26 | 0.8.15: Remove prefetch | diff --git a/Cargo.toml b/Cargo.toml
index bbca34b..75d7b7b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "xxhash-rust"
-version = "0.8.14"
+version = "0.8.15"
authors = ["Douman <douman@gmx.se>"]
edition = "2018"
description = "Implementation of xxhash"
diff --git a/src/utils.rs b/src/... | 3 | 17 | 25 |
c359aee58ae88629a296b2b9d638d88fad2ac46d | DoumanAsh | 2024-12-23T22:29:36 | 0.8.14: Remove overly eager prefetch | diff --git a/Cargo.toml b/Cargo.toml
index dafdd66..bbca34b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "xxhash-rust"
-version = "0.8.13"
+version = "0.8.14"
authors = ["Douman <douman@gmx.se>"]
edition = "2018"
description = "Implementation of xxhash"
diff --git a/src/lib.rs b/src/li... | 3 | 13 | 3 |
7225ff28a4cf417ef250818ab80ef76b7efa324b | DoumanAsh | 2024-12-21T10:24:36 | Refine code base | diff --git a/src/xxh3.rs b/src/xxh3.rs
index f622215..1d199c4 100644
--- a/src/xxh3.rs
+++ b/src/xxh3.rs
@@ -71,6 +71,12 @@ fn _mm_prefetch(_ptr: *const i8, _offset: isize) {
}
}
+macro_rules! to_u128 {
+ ($lo:expr, $hi:expr) => {
+ ($lo) as u128 | ((($hi) as u128) << 64)
+ };
+}
+
macro_rules! sl... | 2 | 62 | 35 |
e696a0e8af1a9519886cc77f501c0c60dfc27b11 | DoumanAsh | 2024-12-20T00:35:38 | Re-arrange inline directives further | diff --git a/src/xxh3.rs b/src/xxh3.rs
index 7a79bad..376c4c8 100644
--- a/src/xxh3.rs
+++ b/src/xxh3.rs
@@ -932,7 +932,6 @@ impl Xxh3Default {
}
///Computes hash.
- #[inline]
pub fn digest(&self) -> u64 {
//Separating digest mid sized allows us to inline this function, which benefits
... | 1 | 3 | 4 |
9989edf6977b34cef2aaac6c70d843b17adf5637 | DoumanAsh | 2024-12-20T00:26:51 | Re-arrange inline directives to further optimize calls | diff --git a/src/xxh3.rs b/src/xxh3.rs
index 0f94015..7a79bad 100644
--- a/src/xxh3.rs
+++ b/src/xxh3.rs
@@ -632,27 +632,34 @@ fn xxh3_64_7to128(input: &[u8], seed: u64, secret: &[u8]) -> u64 {
#[inline(never)]
fn xxh3_64_129to240(input: &[u8], seed: u64, secret: &[u8]) -> u64 {
+ const INITIAL_CHUNK_LEN: usize ... | 1 | 18 | 9 |
1821288794dde93c7006ec714087a037d3bfe55a | DoumanAsh | 2024-12-19T13:26:54 | align xxh3 64 and 128 impls | diff --git a/src/xxh3.rs b/src/xxh3.rs
index c41fef5..0f94015 100644
--- a/src/xxh3.rs
+++ b/src/xxh3.rs
@@ -515,13 +515,14 @@ fn hash_long_internal_loop(acc: &mut Acc, input: &[u8], secret: &[u8]) {
#[inline(always)]
fn xxh3_64_1to3(input: &[u8], seed: u64, secret: &[u8]) -> u64 {
- debug_assert!(input.len() >=... | 1 | 8 | 7 |
b106e4d747c36af9b00dd6adf90bdf2511f1e809 | DoumanAsh | 2024-10-15T23:31:56 | Add details on when to use Xxh3Default | diff --git a/src/xxh3.rs b/src/xxh3.rs
index c7dc6da..c41fef5 100644
--- a/src/xxh3.rs
+++ b/src/xxh3.rs
@@ -844,6 +844,8 @@ fn xxh3_stateful_digest_internal(acc: &mut Acc, nb_stripes_acc: usize, buffer: &
///Default XXH3 Streaming algorithm
///
///This is optimized version of Xxh3 struct that uses default seed/secr... | 1 | 5 | 0 |
c84f5ed0f0a558e92ca1179a129c7ad7a16476c4 | Arpan Kapoor | 2024-09-21T06:12:50 | update avx2 from upstream (#46) | diff --git a/src/xxh3.rs b/src/xxh3.rs
index ca7b874..c7dc6da 100644
--- a/src/xxh3.rs
+++ b/src/xxh3.rs
@@ -313,7 +313,7 @@ fn accumulate_512_avx2(acc: &mut Acc, input: &StripeLanes, secret: &StripeLanes)
let key_vec = _mm256_loadu_si256(secret[idx].as_ptr() as _);
let data_key = _mm256_xor_s... | 1 | 2 | 2 |
f2ed776069434517cace33022fb00969c8d29b0a | DoumanAsh | 2024-07-27T06:15:59 | Correct comment | diff --git a/src/xxh3.rs b/src/xxh3.rs
index 61d9f35..ca7b874 100644
--- a/src/xxh3.rs
+++ b/src/xxh3.rs
@@ -129,7 +129,7 @@ fn mix16_b(input: &[[u8; 8]; 2], secret: &[[u8; 8]; 2], seed: u64) -> u64 {
#[inline(always)]
//Inputs are two chunks of unaligned u64
-//Secret are two chunks of unaligned (u64, u16)
+//Secr... | 1 | 1 | 1 |
cc7076d51971208f19d70d319c5049d65c1dc456 | DoumanAsh | 2024-07-26T23:18:31 | Cleanup const xxh3 | diff --git a/src/const_xxh3.rs b/src/const_xxh3.rs
index fbd537f..13ed584 100644
--- a/src/const_xxh3.rs
+++ b/src/const_xxh3.rs
@@ -336,23 +336,9 @@ const fn xxh3_128_9to16(input: &[u8], seed: u64, secret: &[u8]) -> u128 {
mul_low = mul_low.wrapping_add((input.len() as u64 - 1) << 54);
input_hi ^= flip_hi;... | 1 | 3 | 17 |
8d25c57757d4ee9c062ae800c62e9ec915e86ae6 | Douman | 2024-07-26T15:39:08 | Attempt to optimize state (#43)
* Attempt to optimize state
* Improve codegen for Xxh3 finalization
* Add new Xxh3Default with minimal state
* Extract common functions between Xxh3 and Xxh3Default
* Correct ctor
---------
Co-authored-by: Arthur Silva <arthurprs@gmail.com> | diff --git a/src/xxh3.rs b/src/xxh3.rs
index 34c98c9..967469f 100644
--- a/src/xxh3.rs
+++ b/src/xxh3.rs
@@ -3,7 +3,7 @@
//!Provides `Hasher` only for 64bit as 128bit variant would not be much different due to trait
//!being limited to `u64` outputs.
-use core::{ptr, mem};
+use core::{ptr, mem, slice, hash};
use... | 2 | 379 | 164 |
dfeb229ff577207f46fbcb353a104f697d9c5cb0 | DoumanAsh | 2024-05-16T22:54:45 | Fix copy-paste error | diff --git a/src/xxh3.rs b/src/xxh3.rs
index 26e70f0..41e36b6 100644
--- a/src/xxh3.rs
+++ b/src/xxh3.rs
@@ -246,7 +246,7 @@ fn accumulate_512_neon(acc: &mut Acc, input: *const u8, secret: *const u8) {
#[cfg(target_arch = "aarch64")]
let sum_2 = vmlal_high_u32(data_swap_2, data_key_lo, data_ke... | 1 | 1 | 1 |
4e5c1f13c3a54248e034c21df19d302140bdb9ac | DoumanAsh | 2024-02-19T12:47:14 | Reduce slicing in xxh32/64 loops | diff --git a/src/xxh32.rs b/src/xxh32.rs
index 693259b..3fda954 100644
--- a/src/xxh32.rs
+++ b/src/xxh32.rs
@@ -49,36 +49,45 @@ fn finalize(mut input: u32, mut data: &[u8], is_aligned: bool) -> u32 {
avalanche(input)
}
+#[inline(always)]
+const fn init_v(seed: u32) -> (u32, u32, u32, u32) {
+ (
+ see... | 2 | 85 | 98 |
c557f2c69a9b63151986ed97dac63b572368c264 | DoumanAsh | 2024-02-19T11:21:35 | Tidy up slice access | diff --git a/src/xxh3.rs b/src/xxh3.rs
index a1e5d50..26e70f0 100644
--- a/src/xxh3.rs
+++ b/src/xxh3.rs
@@ -86,17 +86,24 @@ fn read_64le_unaligned(data: *const u8) -> u64 {
}
#[inline(always)]
-fn mix_two_accs(acc: &mut [u64], secret: *const u8) -> u64 {
- mul128_fold64(acc[0] ^ read_64le_unaligned(secret),
- ... | 1 | 18 | 8 |
22217b150d8d044776e3774424a6122699d5223e | DoumanAsh | 2024-02-18T00:18:19 | Refactoring accumulate_512/scramble_acc to be less error prone | diff --git a/src/xxh3.rs b/src/xxh3.rs
index 8af500c..a1e5d50 100644
--- a/src/xxh3.rs
+++ b/src/xxh3.rs
@@ -198,7 +198,6 @@ macro_rules! vld1q_u8 {
}
#[cfg(target_feature = "neon")]
-#[inline(always)]
fn accumulate_512_neon(acc: &mut Acc, input: *const u8, secret: *const u8) {
//Full Neon version from xxhash... | 1 | 20 | 37 |
5479a6601a98be19d66bb84d4a55bac11132c65d | DoumanAsh | 2024-02-17T04:43:11 | Increase input size to xxh3 test up to 4096 bytes | diff --git a/tests/assert_correctness.rs b/tests/assert_correctness.rs
index e1c846f..f0acd76 100644
--- a/tests/assert_correctness.rs
+++ b/tests/assert_correctness.rs
@@ -197,8 +197,8 @@ fn assert_xxh3() {
let mut hasher_1_128 = Xxh3::new();
let mut hasher_2_128 = Xxh3::with_seed(1);
- let mut input = ... | 1 | 2 | 2 |
f44b3d20aa00a399e7dba805ce7762497d64f96c | DoumanAsh | 2024-02-17T04:11:35 | Cleanup aarch64 | diff --git a/src/xxh3.rs b/src/xxh3.rs
index 46cc044..8af500c 100644
--- a/src/xxh3.rs
+++ b/src/xxh3.rs
@@ -247,28 +247,6 @@ fn accumulate_512_neon(acc: &mut Acc, input: *const u8, secret: *const u8) {
idx = idx.wrapping_add(2);
}
-
- while idx < NEON_LANES / 2 {
- /* data_vec... | 1 | 0 | 22 |
3700b45e79a595daa209403ee295da2d04a14ba0 | Yuri Astrakhan | 2023-12-20T05:05:47 | Derive Clone for Xxh32/64
In some obscure cases, like implementing Digest traits for non-cryptographical hashes, I could really use the `Clone` implementation to keep things simpler.
See https://github.com/nyurik/noncrypto-digests | diff --git a/src/xxh32.rs b/src/xxh32.rs
index 60cacdc..693259b 100644
--- a/src/xxh32.rs
+++ b/src/xxh32.rs
@@ -91,6 +91,7 @@ pub fn xxh32(mut input: &[u8], seed: u32) -> u32 {
}
///XXH32 Streaming algorithm
+#[derive(Clone)]
pub struct Xxh32 {
total_len: u32,
is_large_len: bool,
diff --git a/src/xxh64.... | 2 | 2 | 0 |
11ade8ab67d3889a7d8afd72fd98c17b1b92f519 | José Luis Cruz | 2023-10-01T14:55:03 | add `no-std::no-alloc` category and `no-std` keyword | diff --git a/Cargo.toml b/Cargo.toml
index b468141..92a519a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -7,8 +7,8 @@ description = "Implementation of xxhash"
readme = "README.md"
repository = "https://github.com/DoumanAsh/xxhash-rust"
license = "BSL-1.0"
-keywords = ["hash", "xxhash", "xxh3", "hasher"]
-categories =... | 1 | 2 | 2 |
9b7635dd4c5eaa57aeccf58bf1d456eeb2d950a3 | DoumanAsh | 2023-09-07T10:59:04 | 0.8.7: Fix non-issue with MIRI stackful borrows | diff --git a/Cargo.toml b/Cargo.toml
index 75f6ab0..b468141 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "xxhash-rust"
-version = "0.8.6"
+version = "0.8.7"
authors = ["Douman <douman@gmx.se>"]
edition = "2018"
description = "Implementation of xxhash" | 1 | 1 | 1 |
333fdc21c0d011804e3dd9b36f1c74816080c817 | DoumanAsh | 2023-09-07T09:33:40 | Simplify xxh3 stateful update loop and work around shitty MIRI
The problem with MIRI is that it is kinda becoming dumber with introduction of stackful borrows
As removing original slice with slicing ahead and then trying to get offset left of current position break MIRI
Hence code is refactored to use raw pointers onl... | diff --git a/src/xxh3.rs b/src/xxh3.rs
index 6fefb1d..a9999d0 100644
--- a/src/xxh3.rs
+++ b/src/xxh3.rs
@@ -582,16 +582,18 @@ impl Xxh3 {
#[inline]
///Hashes provided chunk
- pub fn update(&mut self, mut input: &[u8]) {
+ pub fn update(&mut self, input: &[u8]) {
const INTERNAL_BUFFER_STRIPES... | 1 | 25 | 66 |
1ace7882592ea4eaa78a2d87d55019b346e8945f | DoumanAsh | 2023-08-01T11:04:09 | Refactoring HW code into separate functions | diff --git a/src/xxh3.rs b/src/xxh3.rs
index 32db00d..c82340c 100644
--- a/src/xxh3.rs
+++ b/src/xxh3.rs
@@ -141,10 +141,9 @@ fn custom_default_secret(seed: u64) -> [u8; DEFAULT_SECRET_SIZE] {
}
}
-//TODO: Should we add AVX?
-// SSE is safe cuz it is available everywhere, but avx should probably be optiona... | 1 | 53 | 23 |
c7ba48bda8c08cb8719e660bb952867850cce60f | DoumanAsh | 2023-08-01T05:04:25 | Check stability of hash against new xxhash C version | diff --git a/Cargo.toml b/Cargo.toml
index aa3b478..75f6ab0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -28,7 +28,7 @@ xxh3 = [] # Enable xxh3 implementation
const_xxh3 = [] # Enable const xxh3 implementation
[dev-dependencies]
-xxhash-c-sys = "0.8.3"
+xxhash-c-sys = "0.8.4"
getrandom = "0.2"
[package.metadata.... | 1 | 1 | 1 |
7751beafd456c3b7e93a871e5dfa4ea7c0d2e3af | DoumanAsh | 2022-09-27T01:53:40 | impl Default for builders | diff --git a/src/xxh3.rs b/src/xxh3.rs
index fa62334..32db00d 100644
--- a/src/xxh3.rs
+++ b/src/xxh3.rs
@@ -765,6 +765,13 @@ impl core::hash::BuildHasher for Xxh3Builder {
}
}
+impl Default for Xxh3Builder {
+ #[inline(always)]
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
//
//128bit
//
d... | 2 | 8 | 1 |
8e5e099f3e0c281ce5011a47d1328a44cce8f5e3 | Dylan DPC | 2022-07-24T09:51:08 | Update Cargo.toml | diff --git a/Cargo.toml b/Cargo.toml
index 89df41f..65fb6c4 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -29,7 +29,7 @@ const_xxh3 = [] # Enable const xxh3 implementation
[dev-dependencies]
xxhash-c-sys = "0.8.3"
-getrandom = "0"
+getrandom = "0.2"
[package.metadata.docs.rs]
features = ["xxh32", "const_xxh32", "... | 1 | 1 | 1 |
b38129978d13da59ffa706d7f3851a546ddbf67f | Douman | 2022-04-23T03:31:20 | Silence useless clippy | diff --git a/Cargo.toml b/Cargo.toml
index adb1e17..89df41f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -7,7 +7,7 @@ description = "Implementation of xxhash"
readme = "README.md"
repository = "https://github.com/DoumanAsh/xxhash-rust"
license = "BSL-1.0"
-keywords = ["hash", "xxhash"]
+keywords = ["hash", "xxhash", ... | 2 | 2 | 1 |
eff50af9f1481f8194a534613e9be89836a5e250 | Douman | 2022-04-14T13:42:06 | Bump xxhash-c-sys | diff --git a/Cargo.toml b/Cargo.toml
index 34eed00..adb1e17 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -28,7 +28,7 @@ xxh3 = [] # Enable xxh3 implementation
const_xxh3 = [] # Enable const xxh3 implementation
[dev-dependencies]
-xxhash-c-sys = "0.8.1"
+xxhash-c-sys = "0.8.3"
getrandom = "0"
[package.metadata.do... | 1 | 1 | 1 |
e31dde0e2f25d496347c8a235e324d83bebbccc8 | Douman | 2022-04-12T02:00:06 | Extract shitty dev dependencies | diff --git a/Cargo.toml b/Cargo.toml
index 36889b9..6f09064 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -16,10 +16,6 @@ include = [
"LICENSE",
]
-[[bench]]
-name = "compare_c"
-harness = false
-
[features]
# XXH32 makes sense only on 32bit platforms
xxh32 = [] # Enable xxh32 implementation
@@ -32,12 +28,8 @@... | 4 | 3 | 409 |
2199d374a99e53ff3fa2ba2728920ddfe2362a73 | Fabio Valentini | 2022-03-16T10:34:39 | include LICENSE file in published crates | diff --git a/Cargo.toml b/Cargo.toml
index af72318..12e362f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,7 +12,8 @@ categories = ["algorithms"]
include = [
"**/*.rs",
"Cargo.toml",
- "README.md"
+ "README.md",
+ "LICENSE",
]
[[bench]] | 1 | 2 | 1 |
3cede0639a996cded384c723fcee39f5f83dd4c9 | Douman | 2022-02-26T02:08:27 | Adjust inlines | diff --git a/src/xxh3.rs b/src/xxh3.rs
index d1a3968..6768cea 100644
--- a/src/xxh3.rs
+++ b/src/xxh3.rs
@@ -420,7 +420,7 @@ fn xxh3_64_internal(input: &[u8], seed: u64, secret: &[u8], long_hash_fn: LongHa
}
}
-#[inline]
+#[inline(always)]
fn xxh3_64_long_impl(input: &[u8], secret: &[u8]) -> u64 {
let mut... | 1 | 5 | 1 |
ab770122d5e0a906b180803756a36e1e631c6d33 | Douman | 2022-02-13T06:33:49 | Incorporated xxh3 improvements | diff --git a/src/xxh3.rs b/src/xxh3.rs
index 75daf25..d1a3968 100644
--- a/src/xxh3.rs
+++ b/src/xxh3.rs
@@ -467,6 +467,7 @@ pub fn xxh3_64_with_secret(input: &[u8], secret: &[u8]) -> u64 {
}
const INTERNAL_BUFFER_SIZE: usize = 256;
+const STRIPES_PER_BLOCK: usize = (DEFAULT_SECRET_SIZE - STRIPE_LEN) / SECRET_CONSU... | 1 | 35 | 3 |
c3d348924fa3b7d040cbf049a2ad4edf2b72796f | Douman | 2022-02-13T01:13:29 | Add Xxh3::digest128 | diff --git a/src/xxh3.rs b/src/xxh3.rs
index 81cd588..75daf25 100644
--- a/src/xxh3.rs
+++ b/src/xxh3.rs
@@ -639,6 +639,28 @@ impl Xxh3 {
xxh3_64_internal(&self.buffer.0[..self.buffered_size as usize], self.seed, &self.custom_secret.0, xxh3_64_long_with_secret)
}
}
+
+ ///Computes hash as ... | 2 | 32 | 0 |
7682076da2984b60bc96965245825cdd0f6a07ff | Douman | 2021-08-12T01:22:03 | Simplify byte reading utilities in xxh32/64 | diff --git a/src/xxh32.rs b/src/xxh32.rs
index f1ea69b..60cacdc 100644
--- a/src/xxh32.rs
+++ b/src/xxh32.rs
@@ -2,26 +2,33 @@
//!
//!Written using C implementation as reference.
-use core::{ptr, mem, slice};
+use core::{ptr, slice};
use crate::xxh32_common::*;
#[inline(always)]
fn read_le_unaligned(data: *c... | 2 | 50 | 30 |
7518130d2f9754954396f4880e94cdcba5bf1484 | Douman | 2021-07-07T02:03:27 | xxh64: Add Default and Builder | diff --git a/src/xxh3.rs b/src/xxh3.rs
index 45e66d9..81cd588 100644
--- a/src/xxh3.rs
+++ b/src/xxh3.rs
@@ -660,6 +660,7 @@ impl core::hash::Hasher for Xxh3 {
}
}
+#[derive(Clone, Copy)]
///Hash builder for `Xxh3`
pub struct Xxh3Builder {
seed: u64,
@@ -692,7 +693,7 @@ impl Xxh3Builder {
#[inline... | 2 | 40 | 1 |
0f8928c1d266c874b7fa9945ab1271800fee96e6 | Douman | 2021-05-08T02:53:18 | Adjust bench features | diff --git a/benches/compare_c.rs b/benches/compare_c.rs
index 920f8d2..74360b2 100644
--- a/benches/compare_c.rs
+++ b/benches/compare_c.rs
@@ -72,6 +72,7 @@ fn define(c: &mut Criterion) {
xxhash_rust::const_xxh64::xxh64(input.as_bytes(), 0);
}, criterion::BatchSize::SmallInput));
+ #[cfg(any(featur... | 1 | 14 | 0 |
acbfe570cd5c21d04cead47a85e2015428ad5977 | Douman | 2021-05-02T02:59:06 | xxh3: Add hash builder | diff --git a/src/xxh3.rs b/src/xxh3.rs
index 3ef163d..45e66d9 100644
--- a/src/xxh3.rs
+++ b/src/xxh3.rs
@@ -660,6 +660,52 @@ impl core::hash::Hasher for Xxh3 {
}
}
+///Hash builder for `Xxh3`
+pub struct Xxh3Builder {
+ seed: u64,
+ secret: [u8; DEFAULT_SECRET_SIZE],
+}
+
+impl Xxh3Builder {
+ #[inlin... | 1 | 46 | 0 |
00975f126f3f6bf75f1981ae084130eaf78d29d3 | Douman | 2021-05-02T02:43:02 | Add size logs to remember stateful hashes sizes | diff --git a/tests/size.rs b/tests/size.rs
new file mode 100644
index 0000000..cdec2c6
--- /dev/null
+++ b/tests/size.rs
@@ -0,0 +1,17 @@
+#[cfg(feature = "xxh32")]
+#[test]
+fn size_xxh32() {
+ assert_eq!(core::mem::size_of::<xxhash_rust::xxh32::Xxh32>(), 44);
+}
+
+#[cfg(feature = "xxh64")]
+#[test]
+fn size_xxh64... | 1 | 17 | 0 |
b343f178a3898cb9f93591c05317843a822a9a9d | Stephane Fontaine | 2021-03-07T17:07:25 | Fix typo to match C implementation.
Fixes #5. | diff --git a/src/xxh3.rs b/src/xxh3.rs
index 5cd72f6..3ef163d 100644
--- a/src/xxh3.rs
+++ b/src/xxh3.rs
@@ -534,14 +534,14 @@ impl Xxh3 {
fn consume_stripes(acc: &mut Acc, nb_stripes: usize, nb_stripes_acc: usize, input: *const u8, secret: &[u8; DEFAULT_SECRET_SIZE]) -> usize {
const STRIPES_PER_BLOCK: u... | 1 | 2 | 2 |
196ee655c0bb87c82e17340a7e21410da1ac2568 | Douman | 2021-03-07T13:05:13 | xxh3: should leave out last chunk up to buffer size, not buffer size - 1 | diff --git a/src/xxh3.rs b/src/xxh3.rs
index 48738da..5cd72f6 100644
--- a/src/xxh3.rs
+++ b/src/xxh3.rs
@@ -575,12 +575,13 @@ impl Xxh3 {
self.buffered_size = 0;
}
+ debug_assert_ne!(input.len(), 0);
if input.len() > INTERNAL_BUFFER_SIZE {
loop {
se... | 2 | 18 | 15 |
fb8ad74dfad4f23a33cdc0b19706b3ae7402ad4a | Ali Farhadi | 2021-01-15T07:12:52 | remove unnecessary `debug_assert!`s | diff --git a/src/xxh3.rs b/src/xxh3.rs
index 4bb76a7..48738da 100644
--- a/src/xxh3.rs
+++ b/src/xxh3.rs
@@ -463,7 +463,6 @@ pub fn xxh3_64_with_seed(input: &[u8], seed: u64) -> u64 {
#[inline]
///Returns 64bit hash for provided input using custom secret.
pub fn xxh3_64_with_secret(input: &[u8], secret: &[u8]) -> u6... | 1 | 0 | 2 |
7917dc9f6fcf268bc1cbac073415c01209149ea1 | Ali Farhadi | 2021-01-14T22:16:41 | Fixing `xxh3_128_with_secret` function. | diff --git a/src/xxh3.rs b/src/xxh3.rs
index 91ef2d2..4bb76a7 100644
--- a/src/xxh3.rs
+++ b/src/xxh3.rs
@@ -890,6 +890,7 @@ pub fn xxh3_128_with_seed(input: &[u8], seed: u64) -> u128 {
#[inline]
///Returns 128 hash for provided input using custom secret.
-pub fn xxh3_128_with_secret(input: &[u8]) -> u128 {
- xx... | 1 | 3 | 2 |
83f0480b6076b54ea4c801801dce45be6ebdafd8 | Douman | 2020-12-05T03:46:23 | Refactoring tests | diff --git a/tests/assert_correctness.rs b/tests/assert_correctness.rs
index 90b8aa2..c998613 100644
--- a/tests/assert_correctness.rs
+++ b/tests/assert_correctness.rs
@@ -1,45 +1,7 @@
-#[allow(unused)]
-const DATA: [&str; 35] = [
- "waifulandshigtgsqwetyuop[]asbnm,./",
- "waifulandshigtgsqwetyuop[]asbnm,.",
- ... | 1 | 38 | 59 |
31f4af2f1e7401541a129d1d223b73023e690224 | Douman | 2020-12-02T09:42:00 | 0.8.0-beta.6 | diff --git a/Cargo.toml b/Cargo.toml
index 0ad8fc9..ea330d3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "xxhash-rust"
-version = "0.8.0-beta.5"
+version = "0.8.0-beta.6"
authors = ["Douman <douman@gmx.se>"]
edition = "2018"
description = "Implementation of xxhash" | 1 | 1 | 1 |
16d09c2984139d8562ec7e24db9763bbef528f63 | Douman | 2020-12-01T12:51:11 | const xxh3 bench | diff --git a/benches/compare_c.rs b/benches/compare_c.rs
index 3253164..920f8d2 100644
--- a/benches/compare_c.rs
+++ b/benches/compare_c.rs
@@ -143,10 +143,15 @@ fn define(c: &mut Criterion) {
}, criterion::BatchSize::SmallInput));
#[cfg(feature = "const_xxh3")]
- c.bench_function("const_xxh3 Rust", |b|... | 1 | 6 | 1 |
1c74e56bf446ddbc324d7e85880f97f930d4d6a6 | Douman | 2020-11-18T11:40:40 | Correct xxh3 docs | diff --git a/src/xxh3.rs b/src/xxh3.rs
index 9c8f095..28ecbd2 100644
--- a/src/xxh3.rs
+++ b/src/xxh3.rs
@@ -1,6 +1,7 @@
//!XXH3 implementation
//!
-//!Provides only 64bit variant as most usable one.
+//!Provides `Hasher` only for 64bit as 128bit variant would not be much different due to trait
+//!being limited to `... | 1 | 2 | 1 |
44e7e150c04973181186a7bc3daed7ca7fefc52a | Douman | 2020-11-18T11:35:19 | Run clippy | diff --git a/src/const_xxh3.rs b/src/const_xxh3.rs
index 1003c34..f97ab62 100644
--- a/src/const_xxh3.rs
+++ b/src/const_xxh3.rs
@@ -290,7 +290,7 @@ const fn xxh3_128_1to3(input: &[u8], seed: u64, secret: &[u8]) -> u128 {
let c1 = input[0];
let c2 = input[input.len() >> 1];
let c3 = input[input.len() - 1... | 2 | 2 | 2 |
7b2100861d4f1dc3f46d85d9671ceca066616231 | Douman | 2020-11-18T11:34:02 | const_xxh3: 128bit | diff --git a/Cargo.toml b/Cargo.toml
index daa5363..0ad8fc9 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "xxhash-rust"
-version = "0.8.0-beta.4"
+version = "0.8.0-beta.5"
authors = ["Douman <douman@gmx.se>"]
edition = "2018"
description = "Implementation of xxhash"
diff --git a/src/con... | 4 | 246 | 76 |
38b7455d3575632d2b2ae3fe8a54c0e55f82721e | Douman | 2020-11-18T10:45:29 | xxh3: 128bit version | diff --git a/benches/compare_c.rs b/benches/compare_c.rs
index ea74415..3253164 100644
--- a/benches/compare_c.rs
+++ b/benches/compare_c.rs
@@ -137,6 +137,11 @@ fn define(c: &mut Criterion) {
hasher.digest();
}, criterion::BatchSize::SmallInput));
+ #[cfg(feature = "xxh3")]
+ c.bench_function("xx... | 3 | 317 | 91 |
1d4153cb779bee353c5a977ba2b9bf85389e9abc | Douman | 2020-10-26T04:53:49 | 0.8.0-beta.4: Use complicated const functions in const_xxh3 only | diff --git a/Cargo.toml b/Cargo.toml
index 5088b59..daa5363 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "xxhash-rust"
-version = "0.8.0-beta.3"
+version = "0.8.0-beta.4"
authors = ["Douman <douman@gmx.se>"]
edition = "2018"
description = "Implementation of xxhash"
diff --git a/src/con... | 5 | 58 | 64 |
c6c4c3125f7532510e05770c19ada6748319f773 | Douman | 2020-10-16T12:33:11 | 0.8.0-beta.3 | diff --git a/Cargo.toml b/Cargo.toml
index 75c5f0f..5088b59 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "xxhash-rust"
-version = "0.8.0-beta.2"
+version = "0.8.0-beta.3"
authors = ["Douman <douman@gmx.se>"]
edition = "2018"
description = "Implementation of xxhash" | 1 | 1 | 1 |
c525f121968d116316ed945a514658d0f64a7f63 | Douman | 2020-10-16T10:37:12 | xxh3 align inlines | diff --git a/benches/compare_c.rs b/benches/compare_c.rs
index 5e807ec..597990d 100644
--- a/benches/compare_c.rs
+++ b/benches/compare_c.rs
@@ -72,18 +72,6 @@ fn define(c: &mut Criterion) {
xxhash_rust::const_xxh64::xxh64(input.as_bytes(), 0);
}, criterion::BatchSize::SmallInput));
- #[cfg(feature =... | 2 | 24 | 30 |
a4eb911dae1547d1c2183dc656b940dfd8263e09 | Douman | 2020-10-16T06:48:05 | Comment on custom vs default seed | diff --git a/src/xxh3.rs b/src/xxh3.rs
index bd488ac..a9d0ef3 100644
--- a/src/xxh3.rs
+++ b/src/xxh3.rs
@@ -180,7 +180,7 @@ fn custom_default_secret(seed: u64) -> [u8; DEFAULT_SECRET_SIZE] {
//Const version is only efficient when it is actually executed at compile time
#[inline(always)]
-///Generates secret derive... | 1 | 9 | 8 |
31bb10bec819054a8efd27e0b1307fa647dc819d | Douman | 2020-10-16T05:17:20 | Add important traits for xxh3 | diff --git a/Cargo.toml b/Cargo.toml
index 485269e..0d26449 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "xxhash-rust"
-version = "0.8.0-beta.1"
+version = "0.8.0-beta.2"
authors = ["Douman <douman@gmx.se>"]
edition = "2018"
description = "Implementation of xxhash"
diff --git a/src/xxh... | 2 | 20 | 1 |
1735a33b35317421d80f507b4a3baf6af4ca6ff1 | Douman | 2020-10-15T20:21:30 | Open custom secret generation at compile time | diff --git a/src/xxh3.rs b/src/xxh3.rs
index 6c3fb56..d456fd2 100644
--- a/src/xxh3.rs
+++ b/src/xxh3.rs
@@ -178,9 +178,12 @@ fn custom_default_secret(seed: u64) -> [u8; DEFAULT_SECRET_SIZE] {
}
}
-//Const version is only efficient when it is actually executed at runtime
+//Const version is only efficient when ... | 1 | 9 | 2 |
4239fd40d76b0b2718aafb1b2910f1365de70877 | Douman | 2020-10-15T19:35:40 | Correct xxh3 | diff --git a/src/xxh3.rs b/src/xxh3.rs
index 698256b..38cab59 100644
--- a/src/xxh3.rs
+++ b/src/xxh3.rs
@@ -20,7 +20,6 @@ const SECRET_LASTACC_START: usize = 7; //not aligned on 8, last secret is diffe
const MID_SIZE_MAX: usize = 240;
const SECRET_SIZE_MIN: usize = 136;
const DEFAULT_SECRET_SIZE: usize = 192;
-con... | 2 | 46 | 5 |
6030baa21ed369a473451807c269a083571bb705 | Douman | 2020-10-15T16:23:15 | Assert secret min size | diff --git a/src/xxh3.rs b/src/xxh3.rs
index 1b7d267..698256b 100644
--- a/src/xxh3.rs
+++ b/src/xxh3.rs
@@ -506,6 +506,7 @@ pub fn xxh3_64_with_seed(input: &[u8], seed: u64) -> u64 {
#[inline]
///Returns 64bit hash for provided input using custom secret.
pub fn xxh3_64_with_secret(input: &[u8], secret: &[u8]) -> u6... | 1 | 1 | 0 |
973124b02a10baebe7ddb8da40a0d15246c8c02c | Douman | 2020-10-15T16:13:57 | initial streaming xxh3 | diff --git a/benches/compare_c.rs b/benches/compare_c.rs
index 828ebf8..190193b 100644
--- a/benches/compare_c.rs
+++ b/benches/compare_c.rs
@@ -78,6 +78,13 @@ fn define(c: &mut Criterion) {
xxhash_rust::xxh3::xxh3_64(input.as_bytes());
}, criterion::BatchSize::SmallInput));
+ #[cfg(feature = "xxh3")... | 3 | 265 | 9 |
9462cdc15e91b05853de7513f4c6c468887c0eca | Douman | 2020-10-15T12:35:05 | Apply clippy | diff --git a/src/xxh3.rs b/src/xxh3.rs
index 7fcefc4..36804df 100644
--- a/src/xxh3.rs
+++ b/src/xxh3.rs
@@ -73,7 +73,7 @@ fn slice_offset_ptr(slice: &[u8], offset: usize) -> *const u8 {
debug_assert!(slice.len() >= offset);
unsafe {
- slice.as_ptr().offset(offset as isize)
+ slice.as_ptr().ad... | 2 | 4 | 4 |
902757c548e330a18349c6f7931ddf2d71124c96 | Douman | 2020-10-13T16:14:36 | Add const xxh32 | diff --git a/Cargo.toml b/Cargo.toml
index f5a7bc9..f2d87df 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -20,7 +20,8 @@ name = "compare_c"
harness = false
[features]
-v32 = []
+xxh32 = [] # Enable xxh32 implementation
+const_xxh32 = [] # Enable const xxh32 implementation
[dev-dependencies]
xxhash-c-sys = "0.8.1"... | 6 | 147 | 18 |
cf880019f72e35a884659a9b29d9eb89b862670b | Kornel | 2025-12-23T23:52:55 | Drop byteorder dep | diff --git a/rmp-serde/Cargo.toml b/rmp-serde/Cargo.toml
index 0376051..adcdcd4 100644
--- a/rmp-serde/Cargo.toml
+++ b/rmp-serde/Cargo.toml
@@ -3,7 +3,7 @@ name = "rmp-serde"
version = "1.3.1"
authors = ["Evgeny Safronov <division494@gmail.com>"]
license = "MIT"
-description = "Serde bindings for RMP"
+description ... | 6 | 15 | 62 |
09eade54a06e68273ad438a2b9bcbbc08ea6f4dc | Kornel | 2024-04-17T20:48:48 | Message length predicting parser | diff --git a/rmp/Cargo.toml b/rmp/Cargo.toml
index 63efc02..a55f843 100644
--- a/rmp/Cargo.toml
+++ b/rmp/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "rmp"
version = "0.8.14"
-authors = ["Evgeny Safronov <division494@gmail.com>"]
+authors = ["Evgeny Safronov <division494@gmail.com>", "Kornel <kornel@geekhood.net>"]
... | 5 | 455 | 1 |
17db0dd41a95fa281f9fd6c0c352a14da2f7242d | Kornel | 2025-02-05T16:06:37 | Drop unnecessary num-traits | diff --git a/rmp-serde/tests/round.rs b/rmp-serde/tests/round.rs
index f59ecff..73fd758 100644
--- a/rmp-serde/tests/round.rs
+++ b/rmp-serde/tests/round.rs
@@ -508,6 +508,8 @@ use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
#[test]
fn roundtrip_tuples_arrays() {
+ assert_roundtrips(Some::<[u8; 0]>([]));
+ assert... | 3 | 6 | 7 |
114b78ffba1202ada90d8309631c75354d6c5f65 | Kornel | 2024-04-30T13:31:48 | Mark example requiring std | diff --git a/rmp/Cargo.toml b/rmp/Cargo.toml
index bca041c..63efc02 100644
--- a/rmp/Cargo.toml
+++ b/rmp/Cargo.toml
@@ -21,6 +21,10 @@ paste = "1.0"
default = ["std"]
std = ["byteorder/std", "num-traits/std"]
+[[example]]
+name = "inspect"
+required-features = ["std"]
+
[dev-dependencies]
quickcheck = "1.0.2" | 1 | 4 | 0 |
454e0c5e18b84c7292c7bd16dda7b9c5920b0db8 | Kornel | 2024-04-18T00:40:41 | Smaller integer for depth | diff --git a/rmp/src/marker.rs b/rmp/src/marker.rs
index 71bfaa1..a403d63 100644
--- a/rmp/src/marker.rs
+++ b/rmp/src/marker.rs
@@ -7,12 +7,11 @@ const FIXMAP_SIZE : u8 = 0x0f;
#[repr(u8)]
pub enum Marker {
FixPos(u8) = 0x00,
- FixNeg(i8) = 0xe0,
FixMap(u8) = 0x80,
FixArray(u8) = 0x90,
FixSt... | 4 | 25 | 27 |
7ddcd2ea4add4225b244e43386bed09a88666766 | Kornel | 2024-04-17T14:01:04 | Decoder/inspector example | diff --git a/rmp/examples/inspect.rs b/rmp/examples/inspect.rs
new file mode 100644
index 0000000..a4943bb
--- /dev/null
+++ b/rmp/examples/inspect.rs
@@ -0,0 +1,135 @@
+use std::fmt;
+use std::io::{self, Read};
+use rmp::{decode::*, Marker};
+
+fn main() {
+ let path = std::env::args_os().nth(1).expect("Specify pat... | 1 | 135 | 0 |
f9f02d83972f010649d4e65c0f50fbabea2d97de | Kornel | 2024-04-17T13:18:03 | Simplify Marker match by reusing discriminant | diff --git a/rmp/Cargo.toml b/rmp/Cargo.toml
index cc522b8..bca041c 100644
--- a/rmp/Cargo.toml
+++ b/rmp/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "rmp"
-version = "0.8.13"
+version = "0.8.14"
authors = ["Evgeny Safronov <division494@gmail.com>"]
license = "MIT"
description = "Pure Rust MessagePack serializatio... | 2 | 30 | 25 |
926682d1d6cfca9c42804a856def8fbc32c79b9e | Kornel | 2024-04-17T13:03:31 | Smaller write len | diff --git a/rmp/src/encode/bin.rs b/rmp/src/encode/bin.rs
index 4a2b5b2..4c70872 100644
--- a/rmp/src/encode/bin.rs
+++ b/rmp/src/encode/bin.rs
@@ -13,19 +13,22 @@ use crate::Marker;
/// This function will return `ValueWriteError` on any I/O error occurred while writing either the
/// marker or the data.
pub fn wri... | 3 | 57 | 65 |
06414f584df4082aa3170794c73e17368e55d727 | Kornel | 2024-04-17T11:57:59 | Handle OOM when writing | diff --git a/rmp-serde/src/encode.rs b/rmp-serde/src/encode.rs
index f22f35a..64b26d3 100644
--- a/rmp-serde/src/encode.rs
+++ b/rmp-serde/src/encode.rs
@@ -1219,9 +1219,9 @@ pub fn to_vec<T>(val: &T) -> Result<Vec<u8>, Error>
where
T: Serialize + ?Sized,
{
- let mut wr = Vec::with_capacity(128);
+ let mut... | 1 | 26 | 4 |
6dd81ee985154224ce3645d43567b5b1ffcee773 | Kornel | 2024-04-16T15:06:26 | Hack to use bytes | diff --git a/rmp-serde/src/bytes.rs b/rmp-serde/src/bytes.rs
new file mode 100644
index 0000000..0d49470
--- /dev/null
+++ b/rmp-serde/src/bytes.rs
@@ -0,0 +1,171 @@
+/// Hacky serializer that only allows `u8`
+
+use std::fmt;
+use serde::ser::Impossible;
+use serde::Serialize;
+
+pub(crate) struct OnlyBytes;
+pub(crat... | 6 | 395 | 10 |
1d9856b0b34b9ed1e5d7d74229612420f19941b2 | Kornel | 2024-04-16T22:35:12 | Chop u32 first | diff --git a/rmp-serde/src/encode.rs b/rmp-serde/src/encode.rs
index 04c8799..73d9380 100644
--- a/rmp-serde/src/encode.rs
+++ b/rmp-serde/src/encode.rs
@@ -178,13 +178,13 @@ impl<'a, W: Write + 'a, C> Serializer<W, C> {
impl<'a, W: Write + 'a, C: SerializerConfig> Serializer<W, C> {
#[inline]
- fn maybe_unk... | 1 | 6 | 4 |
0992f9a179f74ae8c8503e80c5a5b1ca317923c7 | Kornel | 2024-04-16T22:36:19 | Allow err functions to be unified | diff --git a/rmp-serde/src/encode.rs b/rmp-serde/src/encode.rs
index a66e596..04c8799 100644
--- a/rmp-serde/src/encode.rs
+++ b/rmp-serde/src/encode.rs
@@ -704,7 +704,7 @@ impl<'a, W: Write + 'a> serde::Serializer for &mut ExtFieldSerializer<'a, W> {
self.tag.replace(value);
Ok(())
}... | 2 | 201 | 194 |
5725b1c2479c47e1a2b3277818cd1ea471564288 | Kornel | 2024-04-16T22:59:50 | More tests | diff --git a/rmp-serde/tests/round.rs b/rmp-serde/tests/round.rs
index 50f590d..375ad44 100644
--- a/rmp-serde/tests/round.rs
+++ b/rmp-serde/tests/round.rs
@@ -506,6 +506,43 @@ fn round_variant_string() {
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
+#[test]
+fn roundtrip_tuples_arrays() {
+ assert_roundtrips((... | 1 | 37 | 0 |
e8e932b79c412d4e0978fed2f3dc5be4a3335fb3 | Kornel | 2024-04-16T22:51:11 | Clippy/fmt | diff --git a/rmp-serde/src/decode.rs b/rmp-serde/src/decode.rs
index 3bf5f84..382981c 100644
--- a/rmp-serde/src/decode.rs
+++ b/rmp-serde/src/decode.rs
@@ -17,7 +17,7 @@ use serde::de::{self, Deserialize, DeserializeOwned, DeserializeSeed, Unexpected
use serde::forward_to_deserialize_any;
use rmp;
-use rmp::decode... | 17 | 176 | 132 |
a59d5776f2c7a4ee2dd2a97ed598818536e531d4 | Kornel | 2024-04-16T21:11:23 | Fix test | diff --git a/rmp/tests/func/decode/mod.rs b/rmp/tests/func/decode/mod.rs
index 1872f5c..4d9f294 100644
--- a/rmp/tests/func/decode/mod.rs
+++ b/rmp/tests/func/decode/mod.rs
@@ -12,4 +12,4 @@ mod uint;
#[cfg(feature = "std")]
pub type Cursor<'a> = std::io::Cursor<&'a [u8]>;
#[cfg(not(feature = "std"))]
-pub type Curs... | 1 | 1 | 1 |
6d256d4c5807523a779cbd136a593dbf3892bf91 | Kornel | 2024-04-16T14:29:25 | Reduce generics bloat | diff --git a/rmp-serde/src/decode.rs b/rmp-serde/src/decode.rs
index ba9ef0c..3bf5f84 100644
--- a/rmp-serde/src/decode.rs
+++ b/rmp-serde/src/decode.rs
@@ -493,7 +493,10 @@ impl<'de, 'a, R: ReadSlice<'de> + 'a, C: SerializerConfig> de::Deserializer<'de>
Reference::Copied(bytes) => visitor.visit_by... | 1 | 108 | 31 |
da49802ff3bab174c1d17660e2113b8d5f591127 | Kornel | 2024-04-16T14:54:24 | Avoid panics in release mode | diff --git a/rmpv/src/ext/de.rs b/rmpv/src/ext/de.rs
index f02f946..93b7b8b 100644
--- a/rmpv/src/ext/de.rs
+++ b/rmpv/src/ext/de.rs
@@ -691,7 +691,8 @@ impl<'a, 'de: 'a> Deserializer<'de> for &'a mut ExtDeserializer<'de> {
Cow::Borrowed(data) => visitor.visit_borrowed_bytes(data),
}
... | 2 | 6 | 2 |
21b206ce82a582dcb709b21e11423f808bcb072e | Kornel | 2024-04-16T13:45:51 | Use run-time config to avoid monomorphic bloat | diff --git a/rmp-serde/src/config.rs b/rmp-serde/src/config.rs
index 805b3f4..fd1c117 100644
--- a/rmp-serde/src/config.rs
+++ b/rmp-serde/src/config.rs
@@ -23,6 +23,33 @@ mod sealed {
}
}
+#[derive(Copy, Clone, Debug)]
+pub(crate) struct RuntimeConfig {
+ pub(crate) is_human_readable: bool,
+ pub(crate) ... | 3 | 68 | 28 |
9d3d6ecd7f82d743c189d3634b75682d327ba7e0 | Kornel | 2024-04-16T13:21:35 | Simplify config impl | diff --git a/rmp-serde/src/config.rs b/rmp-serde/src/config.rs
index 0c858e2..805b3f4 100644
--- a/rmp-serde/src/config.rs
+++ b/rmp-serde/src/config.rs
@@ -1,8 +1,4 @@
//! Change MessagePack behavior with configuration wrappers.
-use rmp::encode;
-use serde::{Serialize, Serializer};
-
-use crate::encode::{Error, Unde... | 3 | 47 | 135 |
159dd6dcf24fc0c5c51aabd79ddb4c17127d352a | Kornel | 2024-04-16T13:03:42 | Unused variant config | diff --git a/rmp-serde/src/config.rs b/rmp-serde/src/config.rs
index 8282181..0c858e2 100644
--- a/rmp-serde/src/config.rs
+++ b/rmp-serde/src/config.rs
@@ -83,19 +83,6 @@ impl sealed::SerializerConfig for DefaultConfig {
value.serialize(ser)
}
- #[inline]
- fn write_variant_ident<S>(
- ser... | 2 | 5 | 70 |
0b7988301c7e4d7490591672b55f8a42e55715b3 | Kornel | 2024-04-16T12:45:55 | Support decoding i128 from smaller types | diff --git a/rmp-serde/src/decode.rs b/rmp-serde/src/decode.rs
index b600eac..f40217c 100644
--- a/rmp-serde/src/decode.rs
+++ b/rmp-serde/src/decode.rs
@@ -306,26 +306,41 @@ impl<'de, R: ReadSlice<'de>, C: SerializerConfig> Deserializer<R, C> {
self.depth = depth;
}
- fn read_128(&mut self) -> Resul... | 2 | 41 | 21 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.