c2pa-text-binding 0.1.1

C2PA soft binding and content fingerprinting for text assets
Documentation
  • Coverage
  • 7.69%
    1 out of 13 items documented0 out of 0 items with examples
  • Size
  • Source code size: 5.85 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 366.09 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 54s Average build duration of successful builds.
  • all releases: 53s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • writerslogic/c2pa-text-binding
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • dcondrey

Overview

Provides a trait-based interface for text content fingerprinting algorithms compatible with the C2PA Soft Binding framework. Implementations generate content-derived fingerprints that survive reformatting, re-encoding, and partial modification of text content, enabling manifest recovery when hard bindings are broken.

Where hard bindings (cryptographic hashes) break on any byte-level change, soft bindings use perceptual fingerprints to re-associate content with its provenance even after transformation.

Quick Start

[dependencies]
c2pa-text-binding = "0.1"

Implement a fingerprinting algorithm

use c2pa_text_binding::{TextFingerprint, FingerprintResult, Error};

struct MyAlgorithm;

impl TextFingerprint for MyAlgorithm {
    fn algorithm_id(&self) -> &str {
        "com.writerslogic.text-fingerprint-v1"
    }

    fn generate(&self, text: &str) -> Result<FingerprintResult, Error> {
        // Your fingerprinting implementation
        todo!()
    }

    fn match_fingerprint(
        &self,
        text: &str,
        fingerprint: &[u8],
    ) -> Result<f64, Error> {
        // Returns confidence score 0.0..=1.0
        todo!()
    }
}

Register with the Soft Binding Resolution API

Fingerprinting algorithms can be registered with the C2PA Soft Binding Resolution API to enable decentralized manifest recovery for text assets.

Related Crates

Crate Description
c2pa-structured-text Structured text embedding via ASCII armour delimiters
c2pa-text Unstructured text embedding via Unicode Variation Selectors
c2pa-rs Official C2PA SDK

License

Licensed under either of Apache License, Version 2.0 or MIT License at your option.

Built by WritersLogic