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

Function hash_sql

nodedb/src/control/gateway/plan_cache.rs:228–235  ·  view source on GitHub ↗

Helper: FNV-1a 64-bit hash for SQL text.

(sql: &str)

Source from the content-addressed store, hash-verified

226
227/// Helper: FNV-1a 64-bit hash for SQL text.
228pub fn hash_sql(sql: &str) -> u64 {
229 let mut h: u64 = 0xcbf2_9ce4_8422_2325;
230 for byte in sql.as_bytes() {
231 h ^= *byte as u64;
232 h = h.wrapping_mul(0x0000_0100_0000_01b3);
233 }
234 h
235}
236
237/// Helper: hash a slice of placeholder type names.
238pub fn hash_placeholder_types(types: &[&str]) -> u64 {

Calls 1

as_bytesMethod · 0.45