You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

ahash

Package Overview
Dependencies
Maintainers
1
Versions
95
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ahash - cargo Package Compare versions

Comparing version
0.8.7
to
0.8.8
+1
-1
.cargo_vcs_info.json
{
"git": {
"sha1": "ea78b05f0d603d40fa28855ba271f47494862e9d"
"sha1": "669de234e4c7653ff814bed8244cb4d48356c594"
},
"path_in_vcs": ""
}

@@ -9,5 +9,5 @@ name: Rust

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install latest stable
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:

@@ -17,34 +17,15 @@ toolchain: stable

- name: check nostd
uses: actions-rs/cargo@v1
with:
command: check
args: --no-default-features
run: cargo check --no-default-features
- name: test nostd
uses: actions-rs/cargo@v1
with:
command: test
args: --no-default-features
run: cargo test --no-default-features
- name: check constrandom
uses: actions-rs/cargo@v1
with:
command: check
args: --no-default-features --features compile-time-rng
run: cargo check --no-default-features --features compile-time-rng
- name: test constrandom
uses: actions-rs/cargo@v1
with:
command: test
args: --no-default-features --features compile-time-rng
run: cargo test --no-default-features --features compile-time-rng
- name: check fixed-seed
uses: actions-rs/cargo@v1
with:
command: check
args: --no-default-features --features std
run: cargo check --no-default-features --features std
- name: check
uses: actions-rs/cargo@v1
with:
command: check
run: cargo check
- name: test
uses: actions-rs/cargo@v1
with:
command: test
run: cargo test
nightly:

@@ -56,28 +37,16 @@ name: nightly

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install latest nightly
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
override: true
components: clippy
- name: check nightly
uses: actions-rs/cargo@v1
with:
command: check
args: -Z msrv-policy
run: cargo check -Z msrv-policy
- name: test nightly
uses: actions-rs/cargo@v1
with:
command: test
run: cargo test
- name: check serde
uses: actions-rs/cargo@v1
with:
command: check
args: --features serde
run: cargo check --features serde
- name: test serde
uses: actions-rs/cargo@v1
with:
command: test
args: --features serde
run: cargo test --features serde
linux_arm7:

@@ -87,11 +56,14 @@ name: Linux ARMv7

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
target: armv7-unknown-linux-gnueabihf
- uses: actions-rs/cargo@v1
targets: armv7-unknown-linux-gnueabihf
- run: cargo check --target armv7-unknown-linux-gnueabihf
- name: Install 1.72.0
uses: dtolnay/rust-toolchain@master
with:
command: check
args: --target armv7-unknown-linux-gnueabihf
toolchain: 1.72.0
targets: armv7-unknown-linux-gnueabihf
- run: cargo +1.72.0 check --target armv7-unknown-linux-gnueabihf
aarch64-apple-darwin:

@@ -101,11 +73,16 @@ name: Aarch64 Apple Darwin

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
target: aarch64-apple-darwin
- uses: actions-rs/cargo@v1
targets: aarch64-apple-darwin
- run: cargo check --target aarch64-apple-darwin
- run: cargo test
- run: cargo test --no-default-features --features compile-time-rng
- name: Install 1.72.0
uses: dtolnay/rust-toolchain@master
with:
command: check
args: --target aarch64-apple-darwin
toolchain: 1.72.0
targets: aarch64-apple-darwin
- run: cargo +1.72.0 check --target aarch64-apple-darwin
i686-unknown-linux-gnu:

@@ -115,19 +92,23 @@ name: Linux i686

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
target: i686-unknown-linux-gnu
targets: i686-unknown-linux-gnu
- name: Install cross compile tools
run: sudo apt-get install -y gcc-multilib libc6-i386 libc6-dev-i386
- uses: actions-rs/cargo@v1
- run: cargo check --target i686-unknown-linux-gnu
- run: cargo test --target i686-unknown-linux-gnu
- name: check constrandom
run: cargo check --no-default-features --features compile-time-rng --target i686-unknown-linux-gnu
- name: Install 1.72.0
uses: dtolnay/rust-toolchain@master
with:
command: check
args: --target i686-unknown-linux-gnu
- uses: actions-rs/cargo@v1
with:
command: test
args: --target i686-unknown-linux-gnu
toolchain: 1.72.0
targets: i686-unknown-linux-gnu
- run: cargo +1.72.0 check --target i686-unknown-linux-gnu
- name: check constrandom
run: cargo +1.72.0 check --no-default-features --features compile-time-rng --target i686-unknown-linux-gnu
x86_64-unknown-linux-gnu:
name: Linux x86_64 - nightly
name: Linux x86_64
runs-on: ubuntu-latest

@@ -137,16 +118,18 @@ env:

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
override: true
target: x86_64-unknown-linux-gnu
- uses: actions-rs/cargo@v1
targets: x86_64-unknown-linux-gnu
- run: cargo check --target x86_64-unknown-linux-gnu
- run: cargo test --target x86_64-unknown-linux-gnu
- name: check constrandom
run: cargo check --no-default-features --features compile-time-rng --target x86_64-unknown-linux-gnu
- name: Install 1.72.0
uses: dtolnay/rust-toolchain@master
with:
command: check
args: --target x86_64-unknown-linux-gnu
- uses: actions-rs/cargo@v1
with:
command: test
args: --target x86_64-unknown-linux-gnu
toolchain: 1.72.0
- run: cargo +1.72.0 check --target x86_64-unknown-linux-gnu
- name: check constrandom
run: cargo +1.72.0 check --no-default-features --features compile-time-rng --target x86_64-unknown-linux-gnu
thumbv6m:

@@ -156,11 +139,8 @@ name: thumbv6m

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
target: thumbv6m-none-eabi
- uses: actions-rs/cargo@v1
with:
command: check
args: --target thumbv6m-none-eabi --no-default-features
targets: thumbv6m-none-eabi
- run: cargo check --target thumbv6m-none-eabi --no-default-features
wasm32-unknown-unknown:

@@ -170,24 +150,8 @@ name: wasm

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
target: wasm32-unknown-unknown
- uses: actions-rs/cargo@v1
with:
command: check
args: --target wasm32-unknown-unknown --no-default-features
msrv:
name: MSRV
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install 1.60.0
uses: actions-rs/toolchain@v1
with:
toolchain: 1.60.0
- name: check
uses: actions-rs/cargo@v1
with:
command: check
targets: wasm32-unknown-unknown
- run: cargo check --target wasm32-unknown-unknown --no-default-features
no_std:

@@ -197,10 +161,6 @@ name: no-std build

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path=no_std_test/Cargo.toml
- run: cargo build --manifest-path=no_std_test/Cargo.toml

@@ -14,5 +14,5 @@ # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO

edition = "2018"
rust-version = "1.60.0"
rust-version = "1.72.0"
name = "ahash"
version = "0.8.7"
version = "0.8.8"
authors = ["Tom Kaitchuck <Tom.Kaitchuck@gmail.com>"]

@@ -19,0 +19,0 @@ build = "./build.rs"

@@ -111,9 +111,9 @@ use core::hash::{Hash, Hasher};

for shift in 0..16 {
let mut alternitives = vec![];
let mut alternatives = vec![];
for v in 0..256 {
let input = (v as u128) << (shift * 8);
let hasher = constructor(0, 0);
alternitives.push(hash_with(&input, hasher));
alternatives.push(hash_with(&input, hasher));
}
assert_each_byte_differs(shift, base, alternitives);
assert_each_byte_differs(shift, base, alternatives);
}

@@ -126,4 +126,4 @@ }

for shift in 0..16 {
let mut alternitives1 = vec![];
let mut alternitives2 = vec![];
let mut alternatives1 = vec![];
let mut alternatives2 = vec![];
for v in 0..256 {

@@ -135,14 +135,14 @@ let input = (v as u128) << (shift * 8);

let h2 = hash_with(&item, hasher2);
alternitives1.push(h1);
alternitives2.push(h2);
alternatives1.push(h1);
alternatives2.push(h2);
}
assert_each_byte_differs(shift, base, alternitives1);
assert_each_byte_differs(shift, base, alternitives2);
assert_each_byte_differs(shift, base, alternatives1);
assert_each_byte_differs(shift, base, alternatives2);
}
}
fn assert_each_byte_differs(num: u64, base: u64, alternitives: Vec<u64>) {
fn assert_each_byte_differs(num: u64, base: u64, alternatives: Vec<u64>) {
let mut changed_bits = 0_u64;
for alternitive in alternitives {
changed_bits |= base ^ alternitive
for alternative in alternatives {
changed_bits |= base ^ alternative
}

@@ -149,0 +149,0 @@ assert_eq!(

@@ -80,3 +80,3 @@ //! AHash is a high performance keyed hash function.

```
This avoids the need to type "RandomState". (For convience `From`, `Into`, and `Deref` are provided).
This avoids the need to type "RandomState". (For convenience `From`, `Into`, and `Deref` are provided).

@@ -83,0 +83,0 @@ # Aliases

@@ -203,2 +203,28 @@ #![cfg_attr(feature = "specialize", feature(build_hasher_simple_hash_one))]

#[cfg(feature = "std")]
#[test]
fn test_key_ref() {
let mut map = ahash::HashMap::default();
map.insert(1, "test");
assert_eq!(Some((1, "test")), map.remove_entry(&1));
let mut map = ahash::HashMap::default();
map.insert(&1, "test");
assert_eq!(Some((&1, "test")), map.remove_entry(&&1));
let mut m = ahash::HashSet::<Box<String>>::default();
m.insert(Box::from("hello".to_string()));
assert!(m.contains(&"hello".to_string()));
let mut m = ahash::HashSet::<String>::default();
m.insert("hello".to_string());
assert!(m.contains("hello"));
let mut m = ahash::HashSet::<Box<[u8]>>::default();
m.insert(Box::from(&b"hello"[..]));
assert!(m.contains(&b"hello"[..]));
}
fn ahash_vec<H: Hash>(b: &Vec<H>) -> u64 {

@@ -205,0 +231,0 @@ let mut total: u64 = 0;

Sorry, the diff of this file is not supported yet