qraisc-core

Crates.ioqraisc-core
lib.rsqraisc-core
version0.1.0
created_at2026-01-20 19:58:32.481496+00
updated_at2026-01-20 19:58:32.481496+00
descriptionHigh-performance QR code validation and scannability scoring for artistic QR codes
homepage
repositoryhttps://github.com/SuperNovae-ai/qrai-scanner
max_upload_size
id2057428
size130,544
Thibaut MÉLEN (ThibautMelen)

documentation

README

qraisc-core

High-performance QR code validation and scannability scoring

Crates.io Docs.rs License Downloads


🎨 Artistic QR  •  🖼️ Image QR  •  🎯 Custom QR  •  📊 Scannability Score


Decode the undecodable. Built for AI-generated and stylized QR codes
that break standard scanners.


Features · Install · Quick Start · API · QR Code AI


What it does

Validate and score QR codes that standard scanners can't read:

  • Artistic QR codes — AI-generated, stylized, custom designs
  • Image QR codes — QR embedded in photos, illustrations
  • Custom QR codes — Logos, colors, gradients, rounded corners
  • Degraded QR codes — Blurred, low contrast, small size

Installation

[dependencies]
qraisc-core = "0.1"

Quick Start

use qraisc_core::{validate, is_valid, score};

fn main() {
    // Simple validation - just check if QR is readable
    if let Some(content) = is_valid("qr.png") {
        println!("QR contains: {}", content);
    }

    // Get scannability score (0-100)
    let s = score("qr.png");
    println!("Scannability: {}/100", s);

    // Full validation with stress tests
    let bytes = std::fs::read("qr.png").unwrap();
    let result = validate(&bytes).unwrap();

    println!("Score: {}", result.score);
    println!("Content: {:?}", result.content);
}

API Reference

Main Functions

Function Description Returns
validate(&[u8]) Full validation with stress tests Result<ValidationResult>
validate_fast(&[u8]) Reduced stress tests (~2x faster) Result<ValidationResult>
decode_only(&[u8]) Decode without scoring (fastest) Result<DecodeResult>

Convenience Helpers

Function Description Returns
is_valid(path) Check if QR is valid Option<String>
score(path) Get scannability score u8 (0-100)
score_bytes(&[u8]) Score from bytes u8 (0-100)
passes_threshold(path, min) Check minimum score bool
summarize(path) Get simple summary QrSummary

Types

pub struct ValidationResult {
    pub score: u8,                    // 0-100
    pub decodable: bool,
    pub content: Option<String>,
    pub metadata: Option<QrMetadata>,
    pub stress_results: StressResults,
}

pub struct QrMetadata {
    pub version: u8,                  // 1-40
    pub error_correction: ErrorCorrectionLevel,
    pub modules: u8,                  // 21-177
    pub decoders_success: Vec<String>,
}

pub struct StressResults {
    pub original: bool,
    pub downscale_50: bool,
    pub downscale_25: bool,
    pub blur_light: bool,
    pub blur_medium: bool,
    pub low_contrast: bool,
}

Score Interpretation

Score Rating Description
80-100 Excellent Safe for all devices
70-79 Good Production ready
60-69 Acceptable May fail on older phones
40-59 Fair Consider regenerating
0-39 Poor Needs redesign

Performance

Operation Clean QR Artistic QR
decode_only ~20ms ~200ms
validate_fast ~50ms ~500ms
validate ~80ms ~1000ms

License

MIT


Part of QR Code AI by Thibaut MÉLEN & SuperNovae Studio


Thibaut MÉLEN    SuperNovae Studio
Commit count: 48

cargo fmt