sqlitegraph 3.9.0

Embedded graph database with explicit SQLite, native-v3, and combined backend modes; HNSW vector search; and graph algorithms
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use rand::{SeedableRng, rngs::StdRng};
use std::{
    collections::hash_map::DefaultHasher,
    hash::{Hash, Hasher},
};

pub fn fuzz_iterations() -> usize {
    std::env::var("SQLITEGRAPH_FUZZ_ITERS")
        .ok()
        .and_then(|s| s.parse().ok())
        .unwrap_or(256)
}

pub fn labeled_rng(label: &str) -> StdRng {
    let mut hasher = DefaultHasher::new();
    label.hash(&mut hasher);
    StdRng::seed_from_u64(hasher.finish())
}