MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / shared_chunk

Function shared_chunk

atomic-cli/tests/it/git_import_cb9c_test.rs:1969–1979  ·  view source on GitHub ↗

One deterministic xorshift64 chunk seeded by `state`.

(state: u64)

Source from the content-addressed store, hash-verified

1967
1968/// One deterministic xorshift64 chunk seeded by `state`.
1969fn shared_chunk(state: u64) -> Vec<u8> {
1970 let mut x = state;
1971 let mut out = Vec::with_capacity(shared_chunk_len());
1972 for _ in 0..shared_chunk_len() {
1973 x ^= x << 13;
1974 x ^= x >> 7;
1975 x ^= x << 17;
1976 out.push((x & 0xFF) as u8);
1977 }
1978 out
1979}
1980
1981/// Bounded slice view of `chunk`.
1982fn slice_len(chunk: &[u8], len: usize) -> &[u8] {

Callers 1

imported_bytesFunction · 0.85

Calls 2

shared_chunk_lenFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected