thepipelinetool 0.1.3

An *experimental* pipeline orchestration tool drawing on concepts from Apache Airflow
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::hash::{DefaultHasher, Hash, Hasher};

use crate::dev::*;

pub fn hash_dag(nodes: &str, edges: &[(usize, usize)]) -> String {
    let mut hasher = DefaultHasher::new();
    let mut edges: Vec<&(usize, usize)> = edges.iter().collect();
    edges.sort();

    let to_hash = format!(
        "{}{}",
        serde_json::to_string(&nodes).unwrap(),
        &serde_json::to_string(&edges).unwrap()
    );
    to_hash.hash(&mut hasher);
    to_base62(hasher.finish())
}