tanstack_short_link_parse 0.1.0

Parse short links and extract tracking information
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! URL Fingerprint

/// URL Fingerprint for deduplication
#[derive(Debug, Clone, Default)]
pub struct UrlFingerprint {
    pub host: String,
    pub path: String,
}

/// FNV-1a hash
pub fn fnv_hash(input: &str) -> u64 {
    let mut hash: u64 = 0xcbf29ce484222325;
    for byte in input.bytes() {
        hash ^= byte as u64;
        hash = hash.wrapping_mul(0x100000001b3);
    }
    hash
}