MCPcopy Create free account
hub / github.com/ashvardanian/StringZilla / test_hasher_incremental_vs_one_shot

Function test_hasher_incremental_vs_one_shot

scripts/test_stringzilla.py:1015–1027  ·  view source on GitHub ↗
(seed_value: int)

Source from the content-addressed store, hash-verified

1013
1014@pytest.mark.parametrize("seed_value", SEED_VALUES)
1015def test_hasher_incremental_vs_one_shot(seed_value: int):
1016 data_full = b"hello world"
1017 data_prefix = b"hello "
1018 data_suffix = b"world"
1019
1020 hasher = sz.Hasher(seed=seed_value)
1021 hasher.update(data_prefix)
1022 hasher.update(data_suffix)
1023 streamed_hash = hasher.digest()
1024
1025 expected_hash = sz.hash(data_full, seed=seed_value)
1026 assert isinstance(streamed_hash, int)
1027 assert streamed_hash == expected_hash
1028
1029
1030@pytest.mark.parametrize("seed_value", SEED_VALUES)

Callers

nothing calls this directly

Calls 3

updateMethod · 0.95
digestMethod · 0.95
hashMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…