Skip to main content

Partial QR Code Decoder

Project description

Partial QR Code Decoder

An aggressive QR code decoder that can recover data from partially missing or damaged QR codes.

Usage

partial-qr --input path/to/qr_code_matrix.txt

The input must be either a text file, containing a matrix of characters, or an image file.

When the input is a text file, the content must be a grid of characters, where each character is one of:

  • #, X, 1 - representing a black module
  • , ., 0 - representing a white module
  • ? - representing the unknown cells that the decoder will try to recover

When the input is an image file, the program will try to detect the size of the QR code, but it can sometimes misdetect it, and in that case, the --qr-version option can be used to specify the version of the QR code (1-40). The image must only contain the QR code, in a well-aligned grid with no perspective distortion. Recognizing QR codes from photographs or heavily distorted images is not in the scope of this project, and will not be supported. Each cell in the QR image must be close to a solid black, solid white, or middle gray color, and the program will classify them as black, white, or unknown based on a simple thresholding of the lightness.

If the input is too corrupted, bruteforce strength can be increased, but beware of the exponential runtime increase, especially for higher versions:

partial-qr --input path/to/qr_code_matrix.txt --max-brute-bits 24

Additional hints can be provided to the bruteforce to speed it up:

--ascii - Assume the data is ASCII, which reduces the search space significantly.

--url - Assume the data is a URL, so it must start with either http:// or https://.

--parallel - Enable parallel bruteforce using all available CPU cores.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

partial_qr-0.0.32.tar.gz (29.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

partial_qr-0.0.32-py3-none-any.whl (33.4 kB view details)

Uploaded Python 3

File details

Details for the file partial_qr-0.0.32.tar.gz.

File metadata

  • Download URL: partial_qr-0.0.32.tar.gz
  • Upload date:
  • Size: 29.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for partial_qr-0.0.32.tar.gz
Algorithm Hash digest
SHA256 83b9e07bb81fdd17c8b95da76b024c58966e35d5d675e96fb7fcf8e9af609f7e
MD5 a8638a159de6e1ed9d9a62c59890a734
BLAKE2b-256 c6e96f73c0a7468a48c3a5d49bdb7fbabefe26ec42f0bf82474abc4724d9a4c8

See more details on using hashes here.

File details

Details for the file partial_qr-0.0.32-py3-none-any.whl.

File metadata

  • Download URL: partial_qr-0.0.32-py3-none-any.whl
  • Upload date:
  • Size: 33.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for partial_qr-0.0.32-py3-none-any.whl
Algorithm Hash digest
SHA256 12238b8cfe3b704396728a3403c7532aab2e10de38ec5c4ad5b7fdf25a675700
MD5 a59330a7624055b4d8ff2a32d3b6e89f
BLAKE2b-256 cf06c277e3edf79b49b07246e2b984398a5a68784e0b911c8b5c646f73dbcb3b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page