npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

c2pa-text-binding

v0.2.0

Published

C2PA soft binding and content fingerprinting for text assets (watermark + fingerprint family)

Readme

Overview

A concrete family of text soft-binding algorithms compatible with the C2PA Soft Binding framework, each registered in the C2PA soft binding algorithm list. A soft binding derives a content-keyed value that survives reformatting, re-encoding, excerpting, and light editing, so a manifest is recoverable when the hard binding — a byte-exact hash — has been broken.

| Module | Algorithm (list id) | Kind | |---|---|---| | simhash | com.writerslogic.text-fingerprint.1 (41) | surface fingerprint | | stego | com.writerslogic.zwc-watermark.2 (42) | zero-width watermark | | structure | com.writerslogic.text-structure.1 (43) | structural fingerprint | | minhash | com.writerslogic.text-minhash.1 (44) | excerpt/quotation fingerprint |

This crate is the perceptual/watermark recovery layer. It is distinct from the Variation-Selector transport used elsewhere in WritersProof, which is a hard binding (a c2pa.hash.data over normalized text) and is not soft binding. Registration in the algorithm list is not C2PA conformance certification.

Quick Start

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

Emit and sign a c2pa.soft-binding assertion

soft_binding builds the normative CBOR assertion (it round-trips through the c2pa-rs reader — see tests/c2pa_roundtrip.rs); manifest signs it as a COSE_Sign1 / EdDSA envelope.

use c2pa_text_binding::{simhash::Fingerprint, soft_binding, sign_cose, SOFT_BINDING_LABEL};

let text = "…the document being bound…";
let secret_key = [7u8; 32];                   // caller-supplied Ed25519 secret
let assertion = soft_binding::from_fingerprint(&Fingerprint::compute(text));
let cbor = assertion.to_cbor()?;              // store under SOFT_BINDING_LABEL
let signed = sign_cose(&cbor, &secret_key)?;  // detached-key COSE_Sign1
# Ok::<(), c2pa_text_binding::Error>(())

Recover and classify a candidate

The verify path recomputes the fingerprint from the current text, compares it to the stored value at the algorithm's registered threshold, and returns a confidence tier. BOUND requires a durable fingerprint match (41/44, measured zero false matches) plus the anti-transfer cross-check; a structural (43) match or a watermark hit alone caps at LIKELY. Tier thresholds are grounded in ROBUSTNESS.md.

use c2pa_text_binding::{simhash::Fingerprint, soft_binding::{self, SoftBinding}, verify, Confidence};

let text = "…the document being bound…";
let cbor = soft_binding::from_fingerprint(&Fingerprint::compute(text)).to_cbor()?;

let candidate = SoftBinding::from_cbor(&cbor)?;
let tier = verify(text, &candidate, /*watermark_verified=*/ false, /*crosscheck_ok=*/ true);
assert_eq!(tier, Confidence::Bound);
# Ok::<(), c2pa_text_binding::Error>(())

Register with the Soft Binding Resolution API

These algorithms are registered in the C2PA soft binding algorithm list, so a c2pa.soft-binding assertion referencing them can drive decentralized manifest recovery.

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