Skip to main content

c2pa_text_binding/
fingerprint.rs

1use crate::error::Error;
2
3#[derive(Debug, Clone)]
4pub struct FingerprintResult {
5    pub fingerprint: Vec<u8>,
6    pub algorithm: String,
7    pub confidence: f64,
8}
9
10pub trait TextFingerprint {
11    fn algorithm_id(&self) -> &str;
12
13    fn generate(&self, text: &str) -> Result<FingerprintResult, Error>;
14
15    fn match_fingerprint(
16        &self,
17        text: &str,
18        fingerprint: &[u8],
19    ) -> Result<f64, Error>;
20}