fprint-fp3 0.1.0

FP3 fingerprint-template (de)serialization: fprintd/libfprint's "FP3" GVariant on-disk format <-> fprint-core's Print domain model.
Documentation

fprint-fp3

The FP3 fingerprint-template codec: the edge translator between libfprint/fprintd's on-disk "FP3" blob and the fprint_core::Print domain model. An FP3 blob is the three ASCII bytes "FP3" followed by a little-endian, normal-form GVariant value of type (issbymsmsia{sv}v). Everything wire-specific — the magic, the GVariant signature, the Julian-day dates with their G_MININT32 sentinel, the maybe-strings, the NBIS payload — lives here and never leaks up into fprint-core. It depends only on fprint-core. The public surface is to_bytes and from_bytes.

Quickstart

use fprint_core::{Finger, Minutia, Print, Template};

// `Print` is `#[non_exhaustive]`; build it with the builder, not a struct literal.
let print = Print::builder()
    .template(Template::Nbis(vec![vec![Minutia { x: 12, y: 34, theta: 90 }]]))
    .finger(Finger::RightIndex)
    .username("alice".to_string())
    .build();

let bytes = fprint_fp3::to_bytes(&print)?;         // -> Vec<u8>, starts with fprint_fp3::MAGIC
let same = fprint_fp3::from_bytes(&bytes)?;        // -> Print

The crate-root docs state exactly what round-trips and where two wire-inexpressible distinctions collapse (finger: None and empty driver/device strings).

Links

License

MIT OR Apache-2.0, at your option.