MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / compute_schema_hash

Function compute_schema_hash

nodedb-columnar/src/writer/encode.rs:52–61  ·  view source on GitHub ↗

Compute a simple schema hash for the footer.

(schema: &ColumnarSchema)

Source from the content-addressed store, hash-verified

50
51/// Compute a simple schema hash for the footer.
52pub(super) fn compute_schema_hash(schema: &ColumnarSchema) -> u64 {
53 use std::hash::{Hash, Hasher};
54 // no-determinism: segment compaction footer hash, not Calvin write path; tracked for switch to xxhash with fixed seed
55 let mut hasher = std::collections::hash_map::DefaultHasher::new();
56 for col in &schema.columns {
57 col.name.hash(&mut hasher);
58 format!("{:?}", col.column_type).hash(&mut hasher);
59 }
60 hasher.finish()
61}

Callers 1

write_segmentMethod · 0.85

Calls 2

hashMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected