#[test] fn hash_chunking_vs_not() { // originally from https://gitlab.redox-os.org/redox-os/seahash/issues/5 let c1: &[u8] = b"This hashing algorithm was extracted from the Rustc compiler."; let c2: &[u8] =
b" This is the same hashing algoirthm used for some internal operations in FireFox."; let c3: &[u8] = b" The strength of this algorithm is in hashing 8 bytes at a time on 64-bit platforms, where the FNV algorithm works on one byte at a time.";
#[test] fn test_different_chunk_sizes() { let v = { let c1: &[u8] = b"This hashing algorithm was extracted from the Rustc compiler."; let c2: &[u8] =
b" This is the same hashing algoirthm used for some internal operations in FireFox."; let c3: &[u8] = b" The strength of this algorithm is in hashing 8 bytes at a time on 64-bit platforms, where the FNV algorithm works on one byte at a time.";
[c1, c2, c3].concat()
};
letmut h1 = H::default();
h1.write(&v); let h1 = h1.finish();
for chunk_len in1..v.len() { letmut h2 = H::default(); for w in v.chunks(chunk_len) {
h2.write(w);
} let h2 = h2.finish();
assert_eq!(h1, h2, "failed with chunk_len={}", chunk_len);
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.14 Sekunden
(vorverarbeitet am 2026-08-25)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.